.Let()
Assigns a value as a parameter for this connection.
Method Syntax
db.Let(key string, value interface{})
Arguments
| Arguments | Description |
|---|
key required | Specifies the name of the variable. |
value required | Assigns the value to the variable name. |
Example usage
db.Let("name", new Name { FirstName = "Tobie", LastName = "Morgan Hitchcock" });
db.Query("CREATE person SET name = $name");
db.Query("SELECT * FROM person WHERE name.first_name = $name.first_name");
You can remove the variable from the connection using the Unset() method.