sqlcx v1.0.0 Sqlcx.Query
Summary
Functions
Specs
query(Sqlcx.connection, String.t | char_list, bind: [], into: Enum.t) ::
[Enum.t] |
Sqlcx.sqlite_error
Runs a query and returns the results.
Parameters
db
- A sqlcipher database.sql
- The query to run as a string.opts
- Options to pass into the query. See below for details.
Options
bind
- If your query has parameters in it, you should provide the options to bind as a list.into
- The collection to put results into. This defaults to a list.
Returns
- [results...] on success
- {:error, _} on failure.
Specs
query!(Sqlcx.connection, String.t | char_list, bind: [], into: Enum.t) :: [Enum.t]
Same as query/3
but raises a Sqlcx.QueryError on error.
Returns the results otherwise.