Creates a new connection to the given databaseName (file).
Platform Support
Jaxer Server Framework | Jaxer Client Framework | 1.0 | no |
---|
Constructors
Constructor | Action | Jaxer Server Framework | Jaxer Client Framework | |||||
---|---|---|---|---|---|---|---|---|
Jaxer.DB.SQLite.Connection Constructor(Object connectionParams) : Jaxer.DB.SQLite.Connection
Creates a new connection to the given database (file). If the given database does not yet exist, it is created for you when
you try to open it. The resulting connection object is the only way you interact with the database.
|
Show Details | 1.0 | no | |||||
Jaxer.DB.SQLite.Connection(Object connectionParams) : Jaxer.DB.SQLite.ConnectionCreates a new connection to the given database (file). If the given database does not yet exist, it is created for you when you try to open it. The resulting connection object is the only way you interact with the database. Parameters
Returns
|
Properties
Property | Action | Jaxer Server Framework | Jaxer Client Framework |
---|---|---|---|
Returns the string identifying the database implementation of this connection. You can compare this e.g. to Jaxer.DB.SQLite.IMPLEMENTATION
or Jaxer.DB.MySQL.IMPLEMENTATION
|
No Details | 1.0 | no |
|
|||
Is the connection currently open? Recall that even if the answer is no the connection would automatically be opened when needed.
|
No Details | 1.0 | no |
|
|||
Returns the unique "rowid" of the most recent successful INSERT command on the current connection. If the table has a column
of type INTEGER PRIMARY KEY, this is used as the rowid. If no successful INSERTs have ever occurred on this connection, 0
is returned. Note that unsuccessful INSERTs do not change this value. This is a synonym for lastInsertRowId. See http://www.sqlite.org/c3ref/last_insert_rowid.html
for more details.
|
No Details | 1.0 | no |
|
|||
Returns the unique "rowid" of the most recent successful INSERT command on the current connection. If the table has a column
of type INTEGER PRIMARY KEY, this is used as the rowid. If no successful INSERTs have ever occurred on this connection, 0
is returned. Note that unsuccessful INSERTs do not change this value. This is a synonym for lastInsertId. See http://www.sqlite.org/c3ref/last_insert_rowid.html
for more details.
|
No Details | 1.0 | no |
|
|||
Returns the string identifying the version of the database to which you are connected.
|
No Details | 1.0 | no |
|
Functions
Method | Action | Jaxer Server Framework | Jaxer Client Framework | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Closes the connection if it's open. This is optional, and only does something if the connection is open.
|
No Details | 1.0 | no | ||||||||||||
|
|||||||||||||||
execute(String sql, Object params) : Array<Object>|Jaxer.DB.ResultSet|Number
Executes the given sql using the connection. If the SQL includes ?'s (question marks) as parameter placeholders, the values
of those parameters should be passed in as extra arguments to this function, either as individual arguments or as a single
array.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|
|||||||||||||||
getLastInsertRowId() : Number
Returns the unique "rowid" of the most recent successful INSERT command on the current connection. If the table has a column
of type INTEGER PRIMARY KEY, this is used as the rowid. If no successful INSERTs have ever occurred on this connection, 0
is returned. Note that unsuccessful INSERTs do not change this value. This is the same as asking for the lastInsertRowId or
lastInsertId properties. See http://www.sqlite.org/c3ref/last_insert_rowid.html for more details.
|
Show Details | 1.0 | no | ||||||||||||
Returns
|
|||||||||||||||
mapExecute(String sql, Array arrayOfParameters, [Object options]) : Object
Prepares the given SQL query string on the current default database (as defined in configApps.js) and then iteratively executes
it over the given array of parameters.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|
|||||||||||||||
Opens the connection so queries can be executed. This is optional, since if the connection is not open when it's asked to
execute some SQL, it will open the connection automatically. Also closing the connection is optional.
|
No Details | 1.0 | no | ||||||||||||
|
|||||||||||||||
test(Boolean keepOpen) : Object
Tests the connection by trying to connect and catching and returning any error encountered. If the connection is successful,
returns a null.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|