this method will be called to init the database-file
345727
protected void createFile() throws FileLockException, IOException {
        openChannel();
        filledUpTo = 0;
        accessFile.setLength(DEFAULT_SIZE);
        size = DEFAULT_SIZE;
        filledUpTo = HEADER_SIZE;
        writeHeader();
    }
362039
def initdb():
    

    print("Syncing up database...")
    cwd_to_sys_path()
    if db and hasattr(db, "Model"):
        db.create_all()
        for m in db.Model.__subclasses__():
            if hasattr(m, "initialize__"):
                print("Sync up model: %s ..." % m.__name__)
                getattr(m, "initialize__")()

    print("Done")
779273
def init_db(self):
        '''
        
        '''
        with self.conn.transaction() as t:
            t.execute('''
            CREATE TABLE temporal (
                tuid     INTEGER,
                revision CHAR(12) NOT NULL,
                file     TEXT,
                line     INTEGER
            );''')

            t.execute('''
            CREATE TABLE annotations (
                revision       CHAR(12) NOT NULL,
                file           TEXT,
                annotation     TEXT,
                PRIMARY KEY(revision, file)
            );''')

            # Used in frontier updating
            t.execute('''
            CREATE TABLE latestFileMod (
                file           TEXT,
                revision       CHAR(12) NOT NULL,
                PRIMARY KEY(file)
            );''')

            t.execute("CREATE UNIQUE INDEX temporal_rev_file ON temporal(revision, file, line)")
        Log.note("Tables created successfully")
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();
    }
113405
public function init()
    {

        // initialize the prepared statements
        $this->categoryTextsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_TEXTS));
        $this->categoryTextsByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_TEXTS_BY_PK_AND_STORE_ID));
    }
603436
public void init(BaseDatabase database, Record record)
    {
        m_pTable = null;
        super.init(database, record);
        m_pTable = ((PhysicalDatabase)database).getPDatabase().getPTable(record, true);
        m_pTable.addPTableOwner(this);
    }
995308
public function init()
    {

        // initialize the prepared statements
        $this->customerVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHARS));
        $this->customerVarcharByAttributeCodeAndEntityTypeIdAndAndValueStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_VALUE));
    }
146711
def init(**kwargs):
    

    # TODO: Iterate through all engines in name set.
    database = kwargs.pop('database', False)
    if database and not database_exists(engine['default'].url):
        create_database(engine['default'].url, encoding='utf8')
        clear_cache()

    expression = lambda target, table: table.create(target)
    test = lambda target, table: table.exists(target)
    op(expression, test=test, primary='init', secondary='create', **kwargs)
280490
private void initFromDatabase() throws SQLException, BlockStoreException {
        PreparedStatement ps = conn.get().prepareStatement(getSelectSettingsSQL());
        ResultSet rs;
        ps.setString(1, CHAIN_HEAD_SETTING);
        rs = ps.executeQuery();
        if (!rs.next()) {
            throw new BlockStoreException("corrupt database block store - no chain head pointer");
        }
        Sha256Hash hash = Sha256Hash.wrap(rs.getBytes(1));
        rs.close();
        this.chainHeadBlock = get(hash);
        this.chainHeadHash = hash;
        if (this.chainHeadBlock == null) {
            throw new BlockStoreException("corrupt database block store - head block not found");
        }
        ps.setString(1, VERIFIED_CHAIN_HEAD_SETTING);
        rs = ps.executeQuery();
        if (!rs.next()) {
            throw new BlockStoreException("corrupt database block store - no verified chain head pointer");
        }
        hash = Sha256Hash.wrap(rs.getBytes(1));
        rs.close();
        ps.close();
        this.verifiedChainHeadBlock = get(hash);
        this.verifiedChainHeadHash = hash;
        if (this.verifiedChainHeadBlock == null) {
            throw new BlockStoreException("corrupt database block store - verified head block not found");
        }
    }
479471
public void initialize() throws SQLException {
		if (!Boolean.parseBoolean(System.getProperty(AUTO_CREATE_TABLES))) {
			return;
		}

		if (configuredDaos == null) {
			throw new SQLException("configuredDaos was not set in " + getClass().getSimpleName());
		}

		// find all of the daos and create the tables
		for (Dao<?, ?> dao : configuredDaos) {
			Class<?> clazz = dao.getDataClass();
			try {
				DatabaseTableConfig<?> tableConfig = null;
				if (dao instanceof BaseDaoImpl) {
					tableConfig = ((BaseDaoImpl<?, ?>) dao).getTableConfig();
				}
				if (tableConfig == null) {
					tableConfig = DatabaseTableConfig.fromClass(connectionSource.getDatabaseType(), clazz);
				}
				TableUtils.createTable(connectionSource, tableConfig);
				createdClasses.add(tableConfig);
			} catch (Exception e) {
				// we don't stop because the table might already exist
				System.err.println("Was unable to auto-create table for " + clazz);
				e.printStackTrace();
			}
		}
	}
138294
static void init(String configName) {
		MAIN = DbKit.getConfig(configName).dbProFactory.getDbPro(configName); // new DbPro(configName);
		map.put(configName, MAIN);
	}
1355379
def init_db(db_path):
    """"""
    logger.info("Creating database")
    with closing(connect_database(db_path)) as db:
        with open(SCHEMA, 'r') as f:
            db.cursor().executescript(f.read())
        db.commit()
    return
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
160467
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->module->db, Connection::className());
        if ($this->db->driverName === 'mysql') {
            $this->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
    }
483621
def _initialise_database(self):
        
        self._logger.info('Creating database schema, if necessary')
        self._conn.execute(constants.CREATE_TABLE_TEXT_SQL)
        self._conn.execute(constants.CREATE_TABLE_TEXTNGRAM_SQL)
        self._conn.execute(constants.CREATE_TABLE_TEXTHASNGRAM_SQL)
        self._conn.execute(constants.CREATE_INDEX_TEXTHASNGRAM_SQL)
        self._conn.execute(constants.CREATE_INDEX_TEXT_SQL)
952478
protected final void initialize() {
        // Enabling development mode forces these settings. This is somewhat inelegant, because to configure one of
        // these values differently will require disabling development mode and manually configure the remaining values.
        if (development) {
            loggingSettings.getLoggers().put("org.hibernate.SQL", Level.DEBUG);
            loggingSettings.getLoggers().put("com.metrink.croquet", Level.DEBUG);
        }

        // call the class's init method
        init();
    }
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();
    }