Initialize all SQL functions in the database.
960988
def init_functions(connection):
    """"""
    if settings.CFG["db"]["create_functions"]:
        print("Refreshing SQL functions...")
        for file in path.template_files("../sql/", exts=[".sql"]):
            func = sa.DDL(path.template_str(file))
            LOG.info("Loading: '%s' into database", file)
            connection.execute(func)
            connection.commit()
617441
function init ()
    {
        $this->_a['table'] = 'geo_point';
        $this->_a['engine'] = 'MyISAM';
        $this->_a['cols'] = array(
                'id' => array(
                        'type' => 'Pluf_DB_Field_Sequence',
                        'blank' => true
                ),
                'point' => array(
                        'type' => 'Geo_DB_Field_Point',
                        'blank' => false
                )
        );
        $this->_a['idx'] = array();
        $this->_a['views'] = array();
    }
229714
def __init_defaults(self, config):
        """"""

        provider = self.__provider

        if provider == 'sqlite':
            config.setdefault('dbname', ':memory:')
            config.setdefault('create_db',  True)
        elif provider == 'mysql':
            config.setdefault('port', 3306)
            config.setdefault('charset', 'utf8')
        elif provider == 'postgres':
            config.setdefault('port', 5432)
        elif provider == 'oracle':
            config.setdefault('port', 1521)
        else:
            raise ValueError('Unsupported provider "{}"'.format(provider))

        if provider != 'sqlite':
            config.setdefault('host', 'localhost')
            config.setdefault('user', None)
            config.setdefault('password', None)
            config.setdefault('dbname', None)
251761
public function initialize() {
        parent::initialize();

        $this->addClauses([
            self::UNION => 'UNION {flag} (%s)',
            self::USING => 'USING %s'
        ]);

        $this->addKeywords([
            self::AVG_ROW_LENGTH        => 'AVG_ROW_LENGTH',
            self::BIG_RESULT            => 'SQL_BIG_RESULT',
            self::BUFFER_RESULT         => 'SQL_BUFFER_RESULT',
            self::BTREE                 => 'BTREE',
            self::CACHE                 => 'SQL_CACHE',
            self::CONNECTION            => 'CONNECTION',
            self::DATA_DIRECTORY        => 'DATA DIRECTORY',
            self::DEFAULT_CHARACTER_SET => 'DEFAULT CHARACTER SET',
            self::DEFAULT_COMMENT       => 'DEFAULT COMMENT',
            self::DELAYED               => 'DELAYED',
            self::DELAY_KEY_WRITE       => 'DELAY_KEY_WRITE',
            self::DISTINCT_ROW          => 'DISTINCTROW',
            self::FOR_UPDATE_LOCK       => 'FOR UPDATE',
            self::FULLTEXT              => 'FULLTEXT',
            self::HASH                  => 'HASH',
            self::HIGH_PRIORITY         => 'HIGH_PRIORITY',
            self::INDEX_DIRECTORY       => 'INDEX DIRECTORY',
            self::INSERT_METHOD         => 'INSERT_METHOD',
            self::KEY_BLOCK_SIZE        => 'KEY_BLOCK_SIZE',
            self::LOW_PRIORITY          => 'LOW_PRIORITY',
            self::MAX_ROWS              => 'MAX_ROWS',
            self::MIN_ROWS              => 'MIN_ROWS',
            self::NO_CACHE              => 'SQL_NO_CACHE',
            self::PACK_KEYS             => 'PACK_KEYS',
            self::QUICK                 => 'QUICK',
            self::ROW_FORMAT            => 'ROW_FORMAT',
            self::SHARED_LOCK           => 'LOCK IN SHARE MODE',
            self::SMALL_RESULT          => 'SQL_SMALL_RESULT',
            self::SPATIAL               => 'SPATIAL',
            self::STATS_AUTO_RECALC     => 'STATS_AUTO_RECALC',
            self::STATS_PERSISTENT      => 'STATS_PERSISTENT',
            self::UNIQUE                => 'UNIQUE'
        ]);

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

        // initialize the prepared statements
        $this->customerDecimalsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_DECIMALS));
    }
911440
def init_db():
    """"""
    import reana_db.models
    if not database_exists(engine.url):
        create_database(engine.url)
    Base.metadata.create_all(bind=engine)
1175646
public function init()
    {

        // initialize the parend class
        parent::init();

        // initialize the prepared statements
        $this->categoryVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_VARCHARS));
        $this->categoryVarcharsByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_VARCHARS_BY_PK_AND_STORE_ID));
    }
265721
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressDecimalsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_DECIMALS));
    }
790713
def init_db(self):
    '''

    '''

    # Database Setup, use default if uri not provided
    if self.database == 'sqlite':
        db_path = os.path.join(EXPFACTORY_DATA, '%s.db' % EXPFACTORY_SUBID)
        self.database = 'sqlite:///%s' % db_path

    bot.info("Database located at %s" % self.database)
    self.engine = create_engine(self.database, convert_unicode=True)
    self.session = scoped_session(sessionmaker(autocommit=False,
                                               autoflush=False,
                                               bind=self.engine))
    
    Base.query = self.session.query_property()

    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    import expfactory.database.models
    Base.metadata.create_all(bind=self.engine)
    self.Base = Base
1249851
public function init()
    {

        // initialize the prepared statements
        $this->customerVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_VARCHARS));
        $this->customerVarcharByAttributeCodeAndEntityTypeIdAndAndValueStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_VALUE));
    }
1346154
def init_database(self):
        """"""
        with contextlib.closing(self.database.cursor()) as cursor:
            cursor.execute("""
              CREATE TABLE IF NOT EXISTS users(
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                name VARCHAR(32)
              )
            """)
806339
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_INTS));
    }
949353
void init(BuildSource source) {
        this.sqlInfo = source.getSqlInfo();
        this.join = sqlInfo.getJoin();
        this.params = sqlInfo.getParams();
        this.context = source.getParamObj();
        this.prefix = source.getPrefix();
        this.suffix = source.getSuffix();
    }
390042
public function init()
    {

        // initialize the prepared statements
        $this->productDecimalsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_DECIMALS));
    }
76808
public function init()
    {

        // initialize the prepared statements
        $this->bundleOptionStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::BUNDLE_OPTION));
    }
555244
static function init()
    {
        if (SettingsDatabase::NEED_CONNECT) {
            $connection_string = 'mysql:host=' . SettingsDatabase::HOST . ';port=' . SettingsDatabase::PORT . ';dbname=' . SettingsDatabase::DBNAME;

            ORM::configure('connection_string', $connection_string);
            ORM::configure('username', SettingsDatabase::USERNAME);
            ORM::configure('password', SettingsDatabase::PASSWORD);
            ORM::configure('logging', SettingsDatabase::LOGGING);
            ORM::configure('driver_options', [
                PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
                PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
                PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
            ]);
        }
    }
655509
public function init()
    {

        // initialize the prepared statements
        $this->categoryDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DATETIMES));
        $this->categoryDatetimesByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DATETIMES_BY_PK_AND_STORE_ID));
    }