HELP: new-result-set
{ $values
- { "query" "a query" } { "handle" alien } { "class" class }
- { "result-set" result-set } }
+ { "query" "a query" } { "handle" alien } { "class" class }
+ { "result-set" result-set } }
{ $description "Creates a new " { $link result-set } " object of type " { $snippet "class" } "." } ;
HELP: new-statement
HELP: bind-statement
{ $values
- { "obj" object } { "statement" statement } }
+ { "obj" object } { "statement" statement } }
{ $description "Sets the statement's " { $slot "bind-params" } " and calls " { $link bind-statement* } " to do the database-specific bind. Sets " { $slot "bound?" } " to true if binding succeeds." } ;
HELP: bind-statement*
{ $values
- { "statement" statement } }
+ { "statement" statement } }
{ $description "Does a low-level bind of the SQL statement's tuple parameters if the database requires. Some databases should treat this as a no-op and bind instead when the actual statement is run." } ;
HELP: <simple-statement>
HELP: low-level-bind
{ $values
- { "statement" statement } }
+ { "statement" statement } }
{ $description "For use with prepared statements, methods on this word should bind the datatype in the SQL spec to its identifier in the SQL string. To name bound variables, SQLite uses identifiers in the form of " { $snippet ":name" } ", while PostgreSQL uses increasing numbers beginning with a dollar sign, e.g. " { $snippet "$1" } "." } ;
HELP: query-results
HELP: in-transaction?
{ $values
- { "?" boolean } }
+ { "?" boolean } }
{ $description "Returns true if there is currently a transaction in progress in this scope." } ;
HELP: query-each
{ $values
- { "result-set" result-set } { "quot" quotation } }
+ { "result-set" result-set } { "quot" quotation } }
{ $description "Applies the quotation to each row of the " { $link result-set } " in order." } ;
HELP: query-map
{ $values
- { "result-set" result-set } { "quot" quotation }
- { "seq" sequence } }
+ { "result-set" result-set } { "quot" quotation }
+ { "seq" sequence } }
{ $description "Applies the quotation to each row of the " { $link result-set } " in order." } ;
HELP: rollback-transaction
HELP: sql-command
{ $values
- { "sql" string } }
+ { "sql" string } }
{ $description "Executes an SQL string using the database in the " { $link db-connection } " symbol." } ;
HELP: sql-query
{ $values
- { "sql" string }
- { "rows" "an array of arrays of strings" } }
+ { "sql" string }
+ { "rows" "an array of arrays of strings" } }
{ $description "Runs an SQL query of raw text in the database in the " { $link db-connection } " symbol. Each row is returned as an array of strings; no type-conversions are done on the resulting data." } ;
{ sql-command sql-query } related-words
HELP: sql-row
{ $values
- { "result-set" result-set }
- { "seq" sequence } }
+ { "result-set" result-set }
+ { "seq" sequence } }
{ $description "Returns the current row in a " { $link result-set } " as an array of strings." } ;
HELP: sql-row-typed
{ $values
- { "result-set" result-set }
- { "seq" sequence } }
+ { "result-set" result-set }
+ { "seq" sequence } }
{ $description "Returns the current row in a " { $link result-set } " as an array of typed Factor objects." } ;
{ sql-row sql-row-typed } related-words
HELP: with-db
{ $values
- { "db" "a database configuration object" } { "quot" quotation } }
+ { "db" "a database configuration object" } { "quot" quotation } }
{ $description "Calls the quotation with a database bound to the " { $link db-connection } " symbol. See " { $link "db-custom-database-combinators" } " for help setting up database access." } ;
HELP: with-transaction
{ $values
- { "quot" quotation } }
+ { "quot" quotation } }
{ $description "Calls the quotation inside a database transaction and commits the result to the database after the quotation finishes. If the quotation throws an error, the transaction is aborted." } ;
ARTICLE: "db" "Database library"