|
Adodb Dokumentation
V5.14 8 Sept 2011
|
Öffentliche Methoden | |
| ADODB_sqlite3 () | |
| ServerInfo () | |
| BeginTrans () | |
| CommitTrans ($ok=true) | |
| RollbackTrans () | |
| MetaColumns ($table, $normalize=true) | |
| _init ($parentDriver) | |
| _insertid () | |
| _affectedrows () | |
| ErrorMsg () | |
| ErrorNo () | |
| SQLDate ($fmt, $col=false) | |
| _createFunctions () | |
| _connect ($argHostname, $argUsername, $argPassword, $argDatabasename) | |
| _pconnect ($argHostname, $argUsername, $argPassword, $argDatabasename) | |
| _query ($sql, $inputarr=false) | |
| SelectLimit ($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0) | |
| GenID ($seq='adodbseq', $start=1) | |
| CreateSequence ($seqname='adodbseq', $start=1) | |
| DropSequence ($seqname) | |
| _close () | |
| MetaIndexes ($table, $primary=FALSE, $owner=false, $owner=false) | |
Datenfelder | |
| $databaseType = "sqlite3" | |
| $replaceQuote = "''" | |
| $concat_operator = '||' | |
| $_errorNo = 0 | |
| $hasLimit = true | |
| $hasInsertID = true | |
| $hasAffectedRows = true | |
| supports autoincrement ID? | |
| $metaTablesSQL = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name" | |
| supports affected rows for update/delete? | |
| $sysDate = "adodb_date('Y-m-d')" | |
| $sysTimeStamp = "adodb_date('Y-m-d H:i:s')" | |
| $fmtTimeStamp = "'Y-m-d H:i:s'" | |
| $_genSeqSQL = "create table %s (id integer)" | |
| $_dropSeqSQL = 'drop table %s' | |
Definiert in Zeile 22 der Datei adodb-sqlite3.inc.php.
| MetaIndexes | ( | $ | table, |
| $ | primary = FALSE, |
||
| $ | owner = false, |
||
| $ | owner = false |
||
| ) |
There must be a more elegant way of doing this, the index elements appear in the SQL statement in cols[1] between parentheses e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
Definiert in Zeile 284 der Datei adodb-sqlite3.inc.php.
{
$false = false;
// save old fetch mode
global $ADODB_FETCH_MODE;
$save = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
if ($this->fetchMode !== FALSE) {
$savem = $this->SetFetchMode(FALSE);
}
$SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
$rs = $this->Execute($SQL);
if (!is_object($rs)) {
if (isset($savem))
$this->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
return $false;
}
$indexes = array ();
while ($row = $rs->FetchRow()) {
if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
if (!isset($indexes[$row[0]])) {
$indexes[$row[0]] = array(
'unique' => preg_match("/unique/i",$row[1]),
'columns' => array());
}
$cols = explode("(",$row[1]);
$cols = explode(")",$cols[1]);
array_pop($cols);
$indexes[$row[0]]['columns'] = $cols;
}
if (isset($savem)) {
$this->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
}
return $indexes;
}