Packagecom.hippohx.sqlite
Classpublic class Connection

The Connection class is the main interface to interact with SQLite databases.



Public Methods
 MethodDefined by
  
Connection(id:String)
Do NOT create a Connection instance directly, use SQLite.open() instead.
Connection
  
close():void
Closes the connection with the database.
Connection
  
dbName():String
Returns the name of the database this Connection is interacting with.
Connection
  
escape(s:String):String
Escapes the passed string.
Connection
  
Returns an integer with the last inserted id on the database.
Connection
  
quote(s:String):String
Escapes the quotes of the passed string.
Connection
  
request(query:String):ResultSet
Runs a query on the database and returns a ResultSet object.
Connection
  
rollback():void
Rollsback the database to the state where startTransaction() was called.
Connection
  
Creates a rollback point.
Connection
Constructor detail
Connection()constructor
public function Connection(id:String)

Do NOT create a Connection instance directly, use SQLite.open() instead.

Parameters
id:String — Unique identifier for the connection.

See also

Method detail
close()method
public function close():void

Closes the connection with the database. If you need to interact with the same database again you have to get a new Connection object with SQL.open().

Neko call is neko.db.Connection.close().

See also

dbName()method 
public function dbName():String

Returns the name of the database this Connection is interacting with.

Neko call is neko.db.Connection.dbName().

Returns
String — A String with the name of the database this Connection is interacting with.
escape()method 
public function escape(s:String):String

Escapes the passed string.

Neko call is neko.db.Connection.escape().

Parameters
s:String

Returns
String — The same String but escaped.
lastInsertId()method 
public function lastInsertId():int

Returns an integer with the last inserted id on the database.

Neko call is neko.db.Connection.lastInsertId().

Returns
int — An integer with the last inserted id on the database.
quote()method 
public function quote(s:String):String

Escapes the quotes of the passed string. Use this as a security messure against SQL injections attacks.

Neko call is neko.db.Connection.quote().

Parameters
s:String

Returns
String — The same string but with escaped quotes.
request()method 
public function request(query:String):ResultSet

Runs a query on the database and returns a ResultSet object.

Neko call is neko.db.Connection.request().

Parameters
query:String — Query to be performed on the database.

Returns
ResultSet — A ResultSet object with data related to your query.

See also

ResultSet
rollback()method 
public function rollback():void

Rollsback the database to the state where startTransaction() was called. See the Wikipedia for more info regarding rollbacks and transactions.

Neko call is neko.db.Connection.rollback().

See also

startTransaction()method 
public function startTransaction():void

Creates a rollback point. See the Wikipedia for more info regarding rollbacks and transactions.

Neko call is neko.db.Connection.startTransaction().

See also