Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

797 lines (733 sloc) 23.914 kB
<?php
/**
* Automatically generated by running "php schema.php sqlite3".
*
* You may modify the file, but re-running schema.php against this file will
* standardize the format without losing your schema changes. It does lose
* any changes that are not part of schema. Use "note" field to comment on
* schema itself, and "note" fields are not used in any code generation but
* only staying within this file.
*/
///////////////////////////////////////////////////////////////////////////////
// Preamble: C++ code inserted at beginning of ext_{name}.h
DefinePreamble(<<<CPP
#include <sqlite3.h>
CPP
);
///////////////////////////////////////////////////////////////////////////////
// Constants
//
// array (
// 'name' => name of the constant
// 'type' => type of the constant
// 'note' => additional note about this constant's schema
// )
DefineConstant(
array(
'name' => "SQLITE3_ASSOC",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_NUM",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_BOTH",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_INTEGER",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_FLOAT",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_TEXT",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_BLOB",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_NULL",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_OPEN_READONLY",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_OPEN_READWRITE",
'type' => Int64,
));
DefineConstant(
array(
'name' => "SQLITE3_OPEN_CREATE",
'type' => Int64,
));
///////////////////////////////////////////////////////////////////////////////
// Functions
//
// array (
// 'name' => name of the function
// 'desc' => description of the function's purpose
// 'flags' => attributes of the function, see base.php for possible values
// 'opt' => optimization callback function's name for compiler
// 'note' => additional note about this function's schema
// 'return' =>
// array (
// 'type' => return type, use Reference for ref return
// 'desc' => description of the return value
// )
// 'args' => arguments
// array (
// 'name' => name of the argument
// 'type' => type of the argument, use Reference for output parameter
// 'value' => default value of the argument
// 'desc' => description of the argument
// )
// )
///////////////////////////////////////////////////////////////////////////////
// Classes
//
// BeginClass
// array (
// 'name' => name of the class
// 'desc' => description of the class's purpose
// 'flags' => attributes of the class, see base.php for possible values
// 'note' => additional note about this class's schema
// 'parent' => parent class name, if any
// 'ifaces' => array of interfaces tihs class implements
// 'bases' => extra internal and special base classes this class requires
// 'footer' => extra C++ inserted at end of class declaration
// )
//
// DefineConstant(..)
// DefineConstant(..)
// ...
// DefineFunction(..)
// DefineFunction(..)
// ...
// DefineProperty
// DefineProperty
//
// array (
// 'name' => name of the property
// 'type' => type of the property
// 'flags' => attributes of the property
// 'desc' => description of the property
// 'note' => additional note about this property's schema
// )
//
// EndClass()
///////////////////////////////////////////////////////////////////////////////
BeginClass(
array(
'name' => "SQLite3",
'desc' => "A class that interfaces SQLite 3 databases.",
'flags' => HasDocComment,
'footer' => <<<EOT
public: void validate() const;
public: sqlite3 *m_raw_db;
DECLARE_BOOST_TYPES(UserDefinedFunc);
struct UserDefinedFunc {
int argc;
Variant func;
Variant step;
Variant fini;
};
public: UserDefinedFuncPtrVec m_udfs;
EOT
,
));
DefineFunction(
array(
'name' => "__construct",
'flags' => HasDocComment,
'return' => array(
'type' => null,
),
'args' => array(
array(
'name' => "filename",
'type' => String,
'desc' => "Path to the SQLite database.",
),
array(
'name' => "flags",
'type' => Int64,
'value' => "k_SQLITE3_OPEN_READWRITE|k_SQLITE3_OPEN_CREATE",
'desc' => "Optional flags used to determine how to open the SQLite database. By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE.\n\nSQLITE3_OPEN_READONLY: Open the database for reading only.\n\nSQLITE3_OPEN_READWRITE: Open the database for reading and writing.\n\nSQLITE3_OPEN_CREATE: Create the database if it does not exist.",
),
array(
'name' => "encryption_key",
'type' => String,
'value' => "null_string",
'desc' => "An optional encryption key used when encrypting and decrypting an SQLite database.",
),
),
));
DefineFunction(
array(
'name' => "open",
'desc' => "Opens an SQLite 3 Database. If the build includes encryption, then it will attempt to use the key.",
'flags' => HasDocComment,
'return' => array(
'type' => null,
'desc' => "Returns TRUE on success, FALSE on failure to open the database.",
),
'args' => array(
array(
'name' => "filename",
'type' => String,
'desc' => "Path to the SQLite database.",
),
array(
'name' => "flags",
'type' => Int64,
'value' => "k_SQLITE3_OPEN_READWRITE|k_SQLITE3_OPEN_CREATE",
'desc' => "Optional flags used to determine how to open the SQLite database. By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE.\n\nSQLITE3_OPEN_READONLY: Open the database for reading only.\n\nSQLITE3_OPEN_READWRITE: Open the database for reading and writing.\n\nSQLITE3_OPEN_CREATE: Create the database if it does not exist.",
),
array(
'name' => "encryption_key",
'type' => String,
'value' => "null_string",
'desc' => "An optional encryption key used when encrypting and decrypting an SQLite database.",
),
),
));
DefineFunction(
array(
'name' => "busytimeout",
'desc' => "Sets a busy handler that will sleep until the database is not locked or the timeout is reached.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success, FALSE on failure.",
),
'args' => array(
array(
'name' => "msecs",
'type' => Int64,
'desc' => "The milliseconds to sleep. Setting this value to a value less than or equal to zero, will turn off an already set timeout handler.",
),
),
));
DefineFunction(
array(
'name' => "close",
'desc' => "Closes the database connection.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success, FALSE on failure.",
),
));
DefineFunction(
array(
'name' => "exec",
'desc' => "Executes a result-less query against a given database.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE if the query succeeded, FALSE on failure.",
),
'args' => array(
array(
'name' => "sql",
'type' => String,
'desc' => "The SQL query to execute (typically an INSERT, UPDATE, or DELETE query).",
),
),
));
DefineFunction(
array(
'name' => "version",
'desc' => "Returns the SQLite3 library version as a string constant and as a number.",
'flags' => HasDocComment,
'return' => array(
'type' => VariantMap,
'desc' => "Returns an associative array with the keys \"versionString\" and \"versionNumber\".",
),
));
DefineFunction(
array(
'name' => "lastinsertrowid",
'desc' => "Returns the row ID of the most recent INSERT into the database.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns the row ID of the most recent INSERT into the database",
),
));
DefineFunction(
array(
'name' => "lasterrorcode",
'desc' => "Returns the numeric result code of the most recent failed SQLite request.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns an integer value representing the numeric result code of the most recent failed SQLite request.",
),
));
DefineFunction(
array(
'name' => "lasterrormsg",
'desc' => "Returns English text describing the most recent failed SQLite request.",
'flags' => HasDocComment,
'return' => array(
'type' => String,
'desc' => "Returns an English string describing the most recent failed SQLite request.",
),
));
DefineFunction(
array(
'name' => "loadextension",
'desc' => "Attempts to load an SQLite extension library.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE if the extension is successfully loaded, FALSE on failure.",
),
'args' => array(
array(
'name' => "extension",
'type' => String,
'desc' => "The name of the library to load. The library must be located in the directory specified in the configure option sqlite3.extension_dir.",
),
),
));
DefineFunction(
array(
'name' => "changes",
'desc' => "Returns the number of database rows that were changed (or inserted or deleted) by the most recent SQL statement.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns an integer value corresponding to the number of database rows changed (or inserted or deleted) by the most recent SQL statement.",
),
));
DefineFunction(
array(
'name' => "escapestring",
'desc' => "Returns a string that has been properly escaped for safe inclusion in an SQL statement.",
'flags' => HasDocComment,
'return' => array(
'type' => String,
'desc' => "Returns a properly escaped string that may be used safely in an SQL statement.",
),
'args' => array(
array(
'name' => "sql",
'type' => String,
'desc' => "The string to be escaped.",
),
),
));
DefineFunction(
array(
'name' => "prepare",
'desc' => "Prepares an SQL statement for execution and returns an SQLite3Stmt object.",
'flags' => HasDocComment,
'return' => array(
'type' => Variant,
'desc' => "Returns an SQLite3Stmt object on success or FALSE on failure.",
),
'args' => array(
array(
'name' => "sql",
'type' => String,
'desc' => "The SQL query to prepare.",
),
),
));
DefineFunction(
array(
'name' => "query",
'desc' => "Executes an SQL query, returning an SQLite3Result object if the query returns results.",
'flags' => HasDocComment,
'return' => array(
'type' => Variant,
'desc' => "Returns an SQLite3Result object if the query returns results. Otherwise, returns TRUE if the query succeeded, FALSE on failure.",
),
'args' => array(
array(
'name' => "sql",
'type' => String,
'desc' => "The SQL query to execute.",
),
),
));
DefineFunction(
array(
'name' => "querysingle",
'desc' => "Executes a query and returns a single result.",
'flags' => HasDocComment,
'return' => array(
'type' => Variant,
'desc' => "Returns the value of the first column of results or an array of the entire first row (if entire_row is TRUE), otherwise FALSE on failure.",
),
'args' => array(
array(
'name' => "sql",
'type' => String,
'desc' => "The SQL query to execute.",
),
array(
'name' => "entire_row",
'type' => Boolean,
'value' => "false",
'desc' => "By default, querySingle returns the value of the first column returned by the query. If entire_row is TRUE, then it returns an array of the entire first row.",
),
),
));
DefineFunction(
array(
'name' => "createfunction",
'desc' => "Registers a PHP function or user-defined function for use as an SQL scalar function for use within SQL statements.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE upon successful creation of the function, FALSE on failure.",
),
'args' => array(
array(
'name' => "name",
'type' => String,
'desc' => "Name of the SQL function to be created or redefined.",
),
array(
'name' => "callback",
'type' => Variant,
'desc' => "The name of a PHP function or user-defined function to apply as a callback, defining the behavior of the SQL function.",
),
array(
'name' => "argcount",
'type' => Int64,
'value' => "-1",
'desc' => "The number of arguments that the SQL function takes. If this parameter is negative, then the SQL function may take any number of arguments.",
),
),
));
DefineFunction(
array(
'name' => "createaggregate",
'desc' => "Registers a PHP function or user-defined function for use as an SQL aggregate function for use within SQL statements.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE upon successful creation of the aggregate, FALSE on failure.",
),
'args' => array(
array(
'name' => "name",
'type' => String,
'desc' => "Name of the SQL aggregate to be created or redefined.",
),
array(
'name' => "step",
'type' => Variant,
'desc' => "The name of a PHP function or user-defined function to apply as a callback for every item in the aggregate.",
),
array(
'name' => "final",
'type' => Variant,
'desc' => "The name of a PHP function or user-defined function to apply as a callback at the end of the aggregate data.",
),
array(
'name' => "argcount",
'type' => Int64,
'value' => "-1",
'desc' => "The number of arguments that the SQL aggregate takes. If this parameter is negative, then the SQL aggregate may take any number of arguments.",
),
),
));
DefineFunction(
array(
'name' => "openblob",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
),
'args' => array(
array(
'name' => "table",
'type' => String,
),
array(
'name' => "column",
'type' => String,
),
array(
'name' => "rowid",
'type' => Int64,
),
array(
'name' => "dbname",
'type' => String,
'value' => "null_string",
),
),
));
EndClass(
);
///////////////////////////////////////////////////////////////////////////////
BeginClass(
array(
'name' => "SQLite3Stmt",
'desc' => "A class that handles prepared statements for the SQLite 3 extension.",
'flags' => HasDocComment,
'footer' => <<<EOT
public: void validate() const;
public: p_SQLite3 m_db;
public: sqlite3_stmt *m_raw_stmt;
DECLARE_BOOST_TYPES(BoundParam);
struct BoundParam {
int type;
int index;
Variant value;
};
public: BoundParamPtrVec m_bound_params;
EOT
,
));
DefineFunction(
array(
'name' => "__construct",
'flags' => HasDocComment,
'return' => array(
'type' => null,
),
'args' => array(
array(
'name' => "dbobject",
'type' => Object,
),
array(
'name' => "statement",
'type' => String,
),
),
));
DefineFunction(
array(
'name' => "paramcount",
'desc' => "Returns the number of parameters within the prepared statement.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns the number of parameters within the prepared statement.",
),
));
DefineFunction(
array(
'name' => "close",
'desc' => "Closes the prepared statement.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE",
),
));
DefineFunction(
array(
'name' => "reset",
'desc' => "Resets the prepared statement to its state prior to execution. All bindings remain intact after reset.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE if the statement is successfully reset, FALSE on failure.",
),
));
DefineFunction(
array(
'name' => "clear",
'desc' => "Clears all current bound parameters.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on successful clearing of bound parameters, FALSE on failure.",
),
));
DefineFunction(
array(
'name' => "bindparam",
'desc' => "Binds a parameter to a statement variable.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE if the parameter is bound to the statement variable, FALSE on failure.",
),
'args' => array(
array(
'name' => "name",
'type' => Variant,
'desc' => "An string identifying the statement variable to which the parameter should be bound.",
),
array(
'name' => "parameter",
'type' => Variant | Reference,
'desc' => "The parameter to bind to a statement variable.",
),
array(
'name' => "type",
'type' => Int64,
'value' => "k_SQLITE3_TEXT",
'desc' => "The data type of the parameter to bind.\n\nSQLITE3_INTEGER: The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.\n\nSQLITE3_FLOAT: The value is a floating point value, stored as an 8-byte IEEE floating point number.\n\nSQLITE3_TEXT: The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16-LE).\n\nSQLITE3_BLOB: The value is a blob of data, stored exactly as it was input.\n\nSQLITE3_NULL: The value is a NULL value.",
),
),
));
DefineFunction(
array(
'name' => "bindvalue",
'desc' => "Binds the value of a parameter to a statement variable.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE if the value is bound to the statement variable, FALSE on failure.",
),
'args' => array(
array(
'name' => "name",
'type' => Variant,
'desc' => "An string identifying the statement variable to which the value should be bound.",
),
array(
'name' => "parameter",
'type' => Variant,
'desc' => "The value to bind to a statement variable.",
),
array(
'name' => "type",
'type' => Int64,
'value' => "k_SQLITE3_TEXT",
'desc' => "The data type of the value to bind.\n\nSQLITE3_INTEGER: The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.\n\nSQLITE3_FLOAT: The value is a floating point value, stored as an 8-byte IEEE floating point number.\n\nSQLITE3_TEXT: The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16-LE).\n\nSQLITE3_BLOB: The value is a blob of data, stored exactly as it was input.\n\nSQLITE3_NULL: The value is a NULL value.",
),
),
));
DefineFunction(
array(
'name' => "execute",
'desc' => "Executes a prepared statement and returns a result set object.",
'flags' => HasDocComment,
'return' => array(
'type' => Variant,
'desc' => "Returns an SQLite3Result object on successful execution of the prepared statement, FALSE on failure.",
),
));
EndClass(
);
///////////////////////////////////////////////////////////////////////////////
BeginClass(
array(
'name' => "SQLite3Result",
'desc' => "A class that handles result sets for the SQLite 3 extension.",
'flags' => HasDocComment,
'footer' => <<<EOT
public: void validate() const;
public: p_SQLite3Stmt m_stmt;
EOT
,
));
DefineFunction(
array(
'name' => "__construct",
'flags' => HasDocComment,
'return' => array(
'type' => null,
),
));
DefineFunction(
array(
'name' => "numcolumns",
'desc' => "Returns the number of columns in the result set.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns the number of columns in the result set.",
),
));
DefineFunction(
array(
'name' => "columnname",
'desc' => "Returns the name of the column specified by the column_number.",
'flags' => HasDocComment,
'return' => array(
'type' => String,
'desc' => "Returns the string name of the column identified by column_number.",
),
'args' => array(
array(
'name' => "column",
'type' => Int64,
'desc' => "The numeric zero-based index of the column.",
),
),
));
DefineFunction(
array(
'name' => "columntype",
'desc' => "Returns the type of the column identified by column_number.",
'flags' => HasDocComment,
'return' => array(
'type' => Int64,
'desc' => "Returns the data type index of the column identified by column_number (one of SQLITE3_INTEGER, SQLITE3_FLOAT, SQLITE3_TEXT, SQLITE3_BLOB, or SQLITE3_NULL).",
),
'args' => array(
array(
'name' => "column",
'type' => Int64,
'desc' => "The numeric zero-based index of the column.",
),
),
));
DefineFunction(
array(
'name' => "fetcharray",
'desc' => "Fetches a result row as an associative or numerically indexed array or both. By default, fetches as both.",
'flags' => HasDocComment,
'return' => array(
'type' => Variant,
'desc' => "Returns a result row as an associatively or numerically indexed array or both.",
),
'args' => array(
array(
'name' => "mode",
'type' => Int64,
'value' => "k_SQLITE3_BOTH",
'desc' => "Controls how the next row will be returned to the caller. This value must be one of either SQLITE3_ASSOC, SQLITE3_NUM, or SQLITE3_BOTH.\n\nSQLITE3_ASSOC: returns an array indexed by column name as returned in the corresponding result set\n\nSQLITE3_NUM: returns an array indexed by column number as returned in the corresponding result set, starting at column 0\n\nSQLITE3_BOTH: returns an array indexed by both column name and number as returned in the corresponding result set, starting at column 0",
),
),
));
DefineFunction(
array(
'name' => "reset",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
),
));
DefineFunction(
array(
'name' => "finalize",
'desc' => "Closes the result set.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE.",
),
));
EndClass(
);
Jump to Line
Something went wrong with that request. Please try again.