API reference
GDSQLiteDB
Synchronous connection to the embedded SQLite.
Methods
exec(sql: String, params: Array = []) -> Dictionary, Errquery(sql: String, params: Array = []) -> Array, Errprepare(sql: String) -> GDSQLiteStatement, Errclose() -> voidis_open() -> bool
exec
exec(sql: String, params: Array = []) -> Dictionary, ErrBind values and execute one SQL statement.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
sql | String | Required | SQL statement; bind external values through the separate parameter array. |
params | Array | [] | Parameter values to bind to a prepared SQL statement. |
Return value
Dictionary, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
query
query(sql: String, params: Array = []) -> Array, ErrBind values and return read-only SQL rows.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
sql | String | Required | SQL statement; bind external values through the separate parameter array. |
params | Array | [] | Parameter values to bind to a prepared SQL statement. |
Return value
Array, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
prepare
prepare(sql: String) -> GDSQLiteStatement, ErrCreate a prepared statement that parses SQL once.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
sql | String | Required | SQL statement; bind external values through the separate parameter array. |
Return value
GDSQLiteStatement, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
close
close() -> voidClose the connection.
Parameters
No parameters.
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
is_open
is_open() -> boolCheck whether the connection is usable.
Parameters
No parameters.
Return value
bool
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.