Create a database.

@param dbName Name of the database to create.
542574
private static void createDB(String dbName) {
        // remove database if it exists
        if (ZooHelper.dbExists(dbName)) {
            ZooHelper.removeDb(dbName);
        }

        // create database
        // By default, all database files will be created in %USER_HOME%/zoodb
        ZooHelper.createDb(dbName);
    }
1154572
@SuppressWarnings("deprecation")
    public Datastore createDatastore(final MongoClient mongoClient, final String dbName) {
        return new DatastoreImpl(this, mongoClient, dbName);
    }
1015565
def create(cls, name, users=None):
        

        api = Client.instance().api

        database_data = {
            'name': name,
            'active': True,
        }

        if isinstance(users, list) or isinstance(users, tuple):
            database_data['users'] = users

        data = api.database.post(data=database_data)

        db = Database(
            name=name,
            api=api,
            kwargs=data
        )

        Client.instance().set_database(name=name)

        return db
821342
def _database_create(self, engine, database):
        
        logger.info('Creating database "%s" in "%s"', database, engine)
        database_operation(engine, 'create', database)
        url = copy(engine.url)
        url.database = database
        return str(url)
482934
public void createDatabase(String database, Map<String, String> replacer) {

        m_errorLogging = true;
        executeSql(database, "create_db.sql", replacer, true);
    }
1053296
def get_or_create(self, db_name):
        
        if not db_name in self:
            res = self.resource.put(db_name)
            if not res[0] == 201:
                raise RuntimeError(
                    'Failed to create database "{}"'.format(db_name)
                )
        return self[db_name]
439300
public function create_database($database) {
		$query = 'CREATE DATABASE ' . $this->quote_identifier($database);
		$statement = $this->get_statement($query);

		$statement->execute();
	}
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)
              )
            """)
725762
def init():
    """"""
    click.secho('Creating database {0}'.format(_db.engine.url),
                fg='green')
    if not database_exists(str(_db.engine.url)):
        create_database(str(_db.engine.url))
647862
def create_database(self, name, character_set=None, collate=None):
        
        if character_set is None:
            character_set = "utf8"
        if collate is None:
            collate = "utf8_general_ci"
        self._database_manager.create(name=name, character_set=character_set,
                collate=collate, return_none=True)
        # Since the API doesn't return the info for creating the database
        # object, we have to do it manually.
        return self._database_manager.find(name=name)
740347
def setup_db(self, couch, dbname):
        

        # Avoid race condition of two creating db
        my_db = None

        self.log.debug('Setting up DB: %s' % dbname)

        if dbname not in couch:
            self.log.info("DB doesn't exist so creating DB: %s", dbname)
            try:
                my_db = couch.create(dbname)
            except:
                self.log.critical("Race condition caught")
                raise RuntimeError("Race condition caught when creating DB")

            try:
                auth_doc = {}
                auth_doc['_id'] = '_design/auth'
                auth_doc['language'] = 'javascript'

                auth_doc['validate_doc_update'] = """
                function(newDoc, oldDoc, userCtx) {
                if (userCtx.roles.indexOf('_admin') !== -1) {
                return;
                } else {
                throw({forbidden: 'Only admins may edit the database'});
                }
                }
                """

                my_db.save(auth_doc)
            except:
                self.log.error('Could not set permissions of %s' % dbname)

        else:
            my_db = couch[dbname]

        return my_db
566935
def createDatabase( dbname, dbdesc, createapptoken = "1" )

      @dbname, @dbdesc, @createapptoken = dbname, dbdesc, createapptoken

      xmlRequestData = toXML( :dbname, @dbname )
      xmlRequestData << toXML( :dbdesc, @dbdesc )
      xmlRequestData << toXML( :createapptoken, @createapptoken )

      sendRequest( :createDatabase, xmlRequestData )

      @dbid = getResponseValue( :dbid )
      @appdbid = getResponseValue( :appdbid )
      @apptoken = getResponseValue( :apptoken )

      return self if @chainAPIcalls
      return @dbid, @appdbid
   end
1204791
def create(name, database=None, auto=False, auto_source=False, directory=None, verbose=None):
    """"""
    router = get_router(directory, database, verbose)
    if auto and auto_source:
        auto = auto_source
    router.create(name, auto=auto)
1094999
function(name, schema, callback){
    var self = this;
    this.db.serialize(function() {
      self.db.run("CREATE TABLE IF NOT EXISTS\"" + name + "\" " + schema, callback);
    });
  }
1224354
public static DataSource createDataSource(String dbName ,boolean initSpatial) throws SQLException {
        return createDataSource(dbName, initSpatial, H2_PARAMETERS);
    }
924591
private DBConn createAndConnectConn(String keyspace) throws DBNotAvailableException, RuntimeException {
        DBConn dbConn = new DBConn(this, keyspace);
        connectDBConn(dbConn);
        return dbConn;
    }
127919
protected function createCacheTable($db,$tableName)
	{
		$driver=$db->getDriverName();
		if($driver==='mysql')
			$blob='LONGBLOB';
		elseif($driver==='pgsql')
			$blob='BYTEA';
		else
			$blob='BLOB';
		$sql=<<<EOD
CREATE TABLE $tableName
(
	id CHAR(128) PRIMARY KEY,
	expire INTEGER,
	value $blob
)
EOD;
		$db->createCommand($sql)->execute();
	}