public function initialize() {
        parent::initialize();

        $this->addClauses([
            self::DEFERRABLE        => 'DEFERRABLE %s',
            self::EITHER            => 'OR %s',
            self::MATCH             => 'MATCH %s',
            self::NOT_DEFERRABLE    => 'NOT DEFERRABLE %s',
            self::UNIQUE_KEY        => 'UNIQUE (%2$s)'
        ]);

        $this->addKeywords([
            self::ABORT             => 'ABORT',
            self::BINARY            => 'BINARY',
            self::AUTO_INCREMENT    => 'AUTOINCREMENT',
            self::FAIL              => 'FAIL',
            self::IGNORE            => 'IGNORE',
            self::INIT_DEFERRED     => 'INITIALLY DEFERRED',
            self::INIT_IMMEDIATE    => 'INITIALLY IMMEDIATE',
            self::NOCASE            => 'NOCASE',
            self::PRIMARY_KEY       => 'PRIMARY KEY',
            self::REPLACE           => 'REPLACE',
            self::ROLLBACK          => 'ROLLBACK',
            self::RTRIM             => 'RTRIM',
            self::UNIQUE            => 'UNIQUE'
        ]);

        $this->addStatements([
            Query::INSERT        => new Statement('INSERT {or} INTO {table} {fields} VALUES {values}'),
            Query::SELECT        => new Statement('SELECT {distinct} {fields} FROM {table} {joins} {where} {groupBy} {having} {compounds} {orderBy} {limit}'),
            Query::UPDATE        => new Statement('UPDATE {or} {table} SET {fields} {where}'),
            Query::DELETE        => new Statement('DELETE FROM {table} {where}'),
            Query::CREATE_TABLE  => new Statement("CREATE {temporary} TABLE IF NOT EXISTS {table} (\n{columns}{keys}\n)"),
            Query::CREATE_INDEX  => new Statement('CREATE {type} INDEX IF NOT EXISTS {index} ON {table} ({fields})'),
            Query::DROP_TABLE    => new Statement('DROP TABLE IF EXISTS {table}'),
            Query::DROP_INDEX    => new Statement('DROP INDEX IF EXISTS {index}')
        ]);

        // SQLite doesn't support TRUNCATE
        unset($this->_statements[Query::TRUNCATE]);
    }
public function initialize() {
        parent::initialize();

        $this->addClauses([
            self::DEFERRABLE        => 'DEFERRABLE %s',
            self::EITHER            => 'OR %s',
            self::MATCH             => 'MATCH %s',
            self::NOT_DEFERRABLE    => 'NOT DEFERRABLE %s',
            self::UNIQUE_KEY        => 'UNIQUE (%2$s)'
        ]);

        $this->addKeywords([
            self::ABORT             => 'ABORT',
            self::BINARY            => 'BINARY',
            self::AUTO_INCREMENT    => 'AUTOINCREMENT',
            self::FAIL              => 'FAIL',
            self::IGNORE            => 'IGNORE',
            self::INIT_DEFERRED     => 'INITIALLY DEFERRED',
            self::INIT_IMMEDIATE    => 'INITIALLY IMMEDIATE',
            self::NOCASE            => 'NOCASE',
            self::PRIMARY_KEY       => 'PRIMARY KEY',
            self::REPLACE           => 'REPLACE',
            self::ROLLBACK          => 'ROLLBACK',
            self::RTRIM             => 'RTRIM',
            self::UNIQUE            => 'UNIQUE'
        ]);

        $this->addStatements([
            Query::INSERT        => new Statement('INSERT {or} INTO {table} {fields} VALUES {values}'),
            Query::SELECT        => new Statement('SELECT {distinct} {fields} FROM {table} {joins} {where} {groupBy} {having} {compounds} {orderBy} {limit}'),
            Query::UPDATE        => new Statement('UPDATE {or} {table} SET {fields} {where}'),
            Query::DELETE        => new Statement('DELETE FROM {table} {where}'),
            Query::CREATE_TABLE  => new Statement("CREATE {temporary} TABLE IF NOT EXISTS {table} (\n{columns}{keys}\n)"),
            Query::CREATE_INDEX  => new Statement('CREATE {type} INDEX IF NOT EXISTS {index} ON {table} ({fields})'),
            Query::DROP_TABLE    => new Statement('DROP TABLE IF EXISTS {table}'),
            Query::DROP_INDEX    => new Statement('DROP INDEX IF EXISTS {index}')
        ]);

        // SQLite doesn't support TRUNCATE
        unset($this->_statements[Query::TRUNCATE]);
    }
public function initialize ( ) { parent :: initialize ( ) ; $ this -> addClauses ( [ self :: DEFERRABLE => 'DEFERRABLE %s' , self :: EITHER => 'OR %s' , self :: MATCH => 'MATCH %s' , self :: NOT_DEFERRABLE => 'NOT DEFERRABLE %s' , self :: UNIQUE_KEY => 'UNIQUE (%2$s)' ] ) ; $ this -> addKeywords ( [ self :: ABORT => 'ABORT' , self :: BINARY => 'BINARY' , self :: AUTO_INCREMENT => 'AUTOINCREMENT' , self :: FAIL => 'FAIL' , self :: IGNORE => 'IGNORE' , self :: INIT_DEFERRED => 'INITIALLY DEFERRED' , self :: INIT_IMMEDIATE => 'INITIALLY IMMEDIATE' , self :: NOCASE => 'NOCASE' , self :: PRIMARY_KEY => 'PRIMARY KEY' , self :: REPLACE => 'REPLACE' , self :: ROLLBACK => 'ROLLBACK' , self :: RTRIM => 'RTRIM' , self :: UNIQUE => 'UNIQUE' ] ) ; $ this -> addStatements ( [ Query :: INSERT => new Statement ( 'INSERT {or} INTO {table} {fields} VALUES {values}' ) , Query :: SELECT => new Statement ( 'SELECT {distinct} {fields} FROM {table} {joins} {where} {groupBy} {having} {compounds} {orderBy} {limit}' ) , Query :: UPDATE => new Statement ( 'UPDATE {or} {table} SET {fields} {where}' ) , Query :: DELETE => new Statement ( 'DELETE FROM {table} {where}' ) , Query :: CREATE_TABLE => new Statement ( "CREATE {temporary} TABLE IF NOT EXISTS {table} (\n{columns}{keys}\n)" ) , Query :: CREATE_INDEX => new Statement ( 'CREATE {type} INDEX IF NOT EXISTS {index} ON {table} ({fields})' ) , Query :: DROP_TABLE => new Statement ( 'DROP TABLE IF EXISTS {table}' ) , Query :: DROP_INDEX => new Statement ( 'DROP INDEX IF EXISTS {index}' ) ] ) ; // SQLite doesn't support TRUNCATE unset ( $ this -> _statements [ Query :: TRUNCATE ] ) ; }
Modify clauses and keywords.
Modify clauses and keywords .