MDB2
[ class tree: MDB2 ] [ index: MDB2 ] [ all elements ]

Class: MDB2_Driver_sqlite

Source Location: /MDB2_Driver_sqlite-0.2.3/MDB2/Driver/sqlite.php

Class Overview

MDB2_Driver_Common
   |
   --MDB2_Driver_sqlite

MDB2 SQLite driver


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
MDB2 SQLite driver


[ Top ]


Class Variables

$escape_quotes =  "'"

[line 59]


Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 69]

MDB2_Driver_sqlite __construct( )

Constructor

[ Top ]

beginTransaction   [line 168]

mixed beginTransaction( )

Start a transaction.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

[ Top ]

commit   [line 197]

mixed commit( )

Commit the database changes done during a transaction that is in progress.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

[ Top ]

connect   [line 264]

true connect( )

Connect to the database
  • Return: on success, MDB2 Error Object on failure

[ Top ]

currID   [line 678]

mixed currID( string $seq_name)

returns the current id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Parameters:

string   $seq_name   —  name of the sequence

[ Top ]

disconnect   [line 336]

mixed disconnect( [ $force = true])

Log out and disconnect from the database.
  • Return: true on success, false if not connected and error object on error
  • Access: public

Parameters:

   $force   — 

[ Top ]

errorInfo   [line 106]

array errorInfo( [integer $error = null])

This method is used to collect information about an error
  • Access: public

Parameters:

integer   $error   — 

[ Top ]

escape   [line 154]

string escape( string $text)

Quotes a string so it can be safely used in a query. It will quote the text so it can safely be used within a query.
  • Return: quoted string
  • Access: public

Parameters:

string   $text   —  the input string to quote

[ Top ]

getServerVersion   [line 462]

mixed getServerVersion( [string $native = false])

return version information about the server
  • Return: array with versoin information or row string
  • Access: public

Parameters:

string   $native   —  determines if the raw version string should be returned

[ Top ]

lastInsertID   [line 655]

mixed lastInsertID( [string $table = null], [ $field = null], mixed $id)

returns the autoincrement ID if supported or $id
  • Return: MDB2 Error Object or id
  • Access: public

Parameters:

mixed   $id   —  value as returned by getBeforeId()
string   $table   —  name of the table into which a new row was inserted
   $field   — 

[ Top ]

nextID   [line 608]

mixed nextID( string $seq_name, [boolean $ondemand = true])

returns the next free id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Parameters:

string   $seq_name   —  name of the sequence
boolean   $ondemand   —  when true the seqence is automatic created, if it not exists

[ Top ]

replace   [line 548]

mixed replace( string $table, array $fields)

Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.

The REPLACE type of query does not make part of the SQL standards. Since practically only SQLite implements it natively, this type of query is emulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.

  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $table   —  name of the table on which the REPLACE query will be executed.
array   $fields   — 

associative array that describes the fields and the values that will be inserted or updated in the specified table. The indexes of the array are the names of all the fields of the table. The values of the array are also associative arrays that describe the values and other properties of the table fields.

Here follows a list of field properties that need to be specified:

value: Value to be assigned to the specified field. This value may be of specified in database independent type format as this function can perform the necessary datatype conversions.

Default: this property is required unless the Null property is set to 1.

type Name of the type of the field. Currently, all types Metabase are supported except for clob and blob.

Default: no type conversion

null Boolean property that indicates that the value for this field should be set to null.

The default value for fields missing in INSERT queries may be specified the definition of a table. Often, the default value is already null, but since the REPLACE may be emulated using an UPDATE query, make sure that all fields of the table are listed in this function argument array.

Default: 0

key Boolean property that indicates that this field should be handled as a primary key or at least as part of the compound unique index of the table that will determine the row that will updated if it exists or inserted a new row otherwise.

This function will fail if no key field is specified or if the value of a key field is set to null because fields that are part of unique index they may not be null.

Default: 0


[ Top ]

rollback   [line 223]

mixed rollback( )

Cancel any database changes done during a transaction that is in progress.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

[ Top ]

_doQuery   [line 363]

result _doQuery( string $query, [boolean $is_manip = false], [resource $connection = null], [string $database_name = null])

Execute a query
  • Return: or error object
  • Access: protected

Parameters:

string   $query   —  query
boolean   $is_manip   —  if the query is a manipulation query
resource   $connection   — 
string   $database_name   — 

[ Top ]

_getDatabaseFile   [line 248]

string _getDatabaseFile( $database_name)

Builds the string with path+dbname+extension
  • Return: full database path+file
  • Access: protected

Parameters:

   $database_name   — 

[ Top ]

_modifyQuery   [line 428]

the _modifyQuery( string $query, $is_manip, $limit, $offset)

Changes a query string for various DBMS specific reasons
  • Return: new (modified) query
  • Access: protected

Parameters:

string   $query   —  query to modify
   $is_manip   — 
   $limit   — 
   $offset   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:32:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.