Sources for file docs/database.txt in version 3.0
Click on a comment to hide it. Click here to show all comments.
DATABASE ABSTRACTION LAYER
Required Files
plugins/database/*
plugins/class/sql.php
plugins/class/input.php
Configuring
// database type, set to one of the above options
public $database_type = 'pgsql';
// database host, in most cases leave this blank for localhost/unix sockets
public $db_host;
// port, it will default to the normal for whichever database type you've picked
public $db_port;
// username for connecting to the database, if required
public $db_user;
// password, same as above.
public $db_passwd;
// persistent database connections, can be good in production, are death in development though
// off by default
public $use_persistent_db_conns = false;
// whether to default to the <db>_insert()/<db>_update()/<db>_delete()/<db>_select() functions or
gen
// the sql and do it ourselves.
public $use_db_insert = true;
public $use_db_update = true;
public $use_db_delete = true;
public $use_db_select = true;
// Database Abstraction Layer
public $load_database = true;
// SQL Generation Classes (not loaded by default, but the database plugin will load
// this if its needed)
public $load_sql = false;
Methods
'db_plugin::_connect' => 'DB: Connect',
'db_plugin::select_db' => 'DB: Select DB',
'db_plugin::exec' => 'DB: Exec',
'db_plugin::query' => 'DB: Exec',
'db_plugin::fetch' => 'DB: Fetch',
'db_plugin::fetch_all' => 'DB: Fetch All',
'db_plugin::fetch_all_objects' => 'DB: Fetch All Objects',
'db_plugin::fetch_all_array' => 'DB: Fetch All Array',
'db_plugin::fetch_object' => 'DB: Fetch Object',
'db_plugin::fetch_array' => 'DB: Fetch Array',
'db_plugin::fetch_column' => 'DB: Fetch Column',
'db_plugin::fetch_result' => 'DB: Fetch Result',
'db_plugin::num_rows' => 'DB: Num Rows',
'db_plugin::numrows' => 'DB: Num Rows',
'db_plugin::affected_rows' => 'DB: Affected Rows',
'db_plugin::get_database_name' => 'DB: Get DB Name',
'db_plugin::copy' => 'DB: Copy',
'db_plugin::insert' => 'DB: Insert',
'db_plugin::update' => 'DB: Update',
'db_plugin::delete' => 'DB: Delete',
'db_plugin::select' => 'DB: Select',
'db_plugin::spec' => 'DB: Load Spec',
'db_plugin::go_back' => 'DB: Go Back',
'db_plugin::sqltext' => 'DB: SQL Text',
'db_plugin::sqlbinary' => 'DB: SQL Binary',
'db_plugin::unsqlbinary' => 'DB: unSQL Binary',
'db_plugin::get_error' => 'DB: Get Error',
// SQL Generation
'sql_plugin::insert' => 'SQL: Insert',
'sql_plugin::delete' => 'SQL: Delete',
'sql_plugin::select' => 'SQL: Select',
'sql_plugin::update' => 'SQL: Update',
Plugins
pgsql
Advanced Usage Examples
DEBUG CONSOLE INFORMATION
open database connections.
debug log.
loaded plugins.
