Create a database on the InfluxDB server.

        :param database: the name of the database to create
        :type database: string
        :rtype: boolean
976653
def create_database(self, database):
        
        url = "db"

        data = {'name': database}

        self.request(
            url=url,
            method='POST',
            data=data,
            expected_response_code=201
        )

        return True
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
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)
244967
def create_db():
    "  "

    from ..ext import db
    db.create_all()

    # Evolution support
    from flask import current_app
    from flaskext.evolution import db as evolution_db
    evolution_db.init_app(current_app)
    evolution_db.create_all()

    print "Database created successfuly"
357875
def init_db(self):
    '''
    '''

    # The user can provide a custom string
    if self.database is None:
        self.logger.error("You must provide a database url, exiting.")
        sys.exit(1)

    self.engine = create_engine(self.database, convert_unicode=True)
    self.session = scoped_session(sessionmaker(autocommit=False,
                                               autoflush=False,
                                               bind=self.engine))

    # Database Setup
    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
    self.Base = Base
    self.Base.metadata.create_all(bind=self.engine)
289235
def _create_db(self):
        
        log.debug("Creating sqlite database")
        self._conn = sqlite3.connect(self._db_filename)

        # create table structure
        self._conn.cursor().execute("""
        CREATE TABLE IF NOT EXISTS {}
        (
          ts REAL,
          arbitration_id INTEGER,
          extended INTEGER,
          remote INTEGER,
          error INTEGER,
          dlc INTEGER,
          data BLOB
        )
        """.format(self.table_name))
        self._conn.commit()

        self._insert_template = "INSERT INTO {} VALUES (?, ?, ?, ?, ?, ?, ?)".format(self.table_name)
143239
public void addDatabase(Database database)
    {
        if (m_databaseCollection == null)
            m_databaseCollection = new DatabaseCollection(this);
        m_databaseCollection.addDatabase(database);
    }
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
1274224
def add_database_user(self, new_username, new_password, permissions=None):
        
        url = "db/{0}/users".format(self._database)

        data = {
            'name': new_username,
            'password': new_password
        }

        if permissions:
            try:
                data['readFrom'], data['writeTo'] = permissions
            except (ValueError, TypeError):
                raise TypeError(
                    "'permissions' must be (readFrom, writeTo) tuple"
                )

        self.request(
            url=url,
            method='POST',
            data=data,
            expected_response_code=200
        )

        return True
456910
def database!(name)
      connection.head name # Check if the URL is valid
      database(name)
    rescue CouchRest::NotFound # Thrown if the HTTP HEAD fails
      create_db(name)
    end
1262129
def create(self):
    
    data = data={"db-name":self.db}
    self.rest('POST', self.uri_str, status_codes=(200,201), data=data)
    return True
379243
def create_db_instance(self, params):
        '''  '''
        if not self.connect_to_aws_rds():
            return False
        try:
            database = self.rdsc.create_dbinstance(
                id=params['id'],
                allocated_storage=params['size'],
                instance_class='db.t1.micro',
                engine='MySQL',
                master_username=params['username'],
                master_password=params['password'],
                db_name=params['dbname'],
                multi_az=False
            )
        except:
            return False
        else:
            return True
812112
def set_database(self, db):
        '''
        
        '''
        # This can not be imported globally due to circular import
        from .database import Database
        assert isinstance(db, Database), "database must be database.Database instance"
        self._database = db
439300
public function create_database($database) {
		$query = 'CREATE DATABASE ' . $this->quote_identifier($database);
		$statement = $this->get_statement($query);

		$statement->execute();
	}
836031
def create(cls, name, database=SYSTEM_DATABASE, type=2):
        

        client = Client.instance()
        api = client.api

        if client.database != database:
            database = client.database

        collection_data = {
            'name': name,
            'type': type,
        }

        data = api.collection.post(data=collection_data)

        collection = Collection(
            name=name,
            database=database,
            api_resource=api.collection,
            api=api,
            kwargs=data
        )

        return collection
510759
def influx_init(self, url, port, user, pwd, db):
        
        try:
            cli = DataFrameClient(url, port, user, pwd, db)
            self.influx_cli = cli
        except Exception as e:
            self.err(e, self.influx_init,
                     "Can not initialize Influxdb database")
1310187
def create_database(self):
        
        from chatterbot.ext.sqlalchemy_app.models import Base
        Base.metadata.create_all(self.engine)