Create a database.
@alias module:db.LDB
@param {Object} options
@returns {LowlevelUp}
512293
function LDB(options) {
  const result = LDB.getBackend(options);
  const backend = result.backend;
  const location = result.location;

  return new LowlevelUp(backend, location, options);
}
803019
function _initSequelize() {
  if (process.env.DATABASE_URL) {
    const dbURL = process.env.DATABASE_URL;
    const dialect = dbURL.split(':')[0];
    const config = Utils.merge(this.config, { dialect });

    return new Sequelize(dbURL, config);
  }

  return new Sequelize(this.config);
}
794707
function _initStorage(options) {
        var self = this;
        var dbInfo = {};
        if (options) {
            for (var i in options) {
                dbInfo[i] = options[i];
            }
        }

        dbInfo.keyPrefix = dbInfo.name + '/';

        self._dbInfo = dbInfo;
        return Promise.resolve();
    }
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);
    }
108550
function AuthDB(options) {
  if (!(this instanceof AuthDB))
    return new AuthDB(options);

  this.logger = Logger.global;
  this.resolve = dns.lookup;
  this.prefix = null;
  this.dnsKnown = [];

  this.known = new Map();
  this.authorized = [];

  this._init(options);
}
1042462
function(options) {
    const Store = require('../../store')

    var self = this
    var primaryKeys = this.definition.primaryKeys
    var condition = {}

    options = options || {}

    for (var i = 0; i < primaryKeys.length; i++) {
      condition[primaryKeys[i]] = this[primaryKeys[i]]
    }

    return self.store.startTransaction(options, function() {
      return self
        .callInterceptors('beforeDestroy', [self, options])
        .then(function() {
          var query = self.definition.query(options)

          return query
            .where(condition)
            .delete()
            .catch(function(error) {
              debug(query.toString())
              throw new Store.SQLError(error)
            })
            .then(function() {
              debug(query.toString())
            })
            .then(function() {
              return self.callInterceptors('afterDestroy', [self, options])
            })
            .then(function() {
              self.__exists = false
              return self
            })
        })
    })
  }
99281
function createReader(db, options) {
  if (options == null) options = {}

  var iterator = db.iterator(options)

  function _read(n) {
    // ignore n for now

    var self = this
    iterator.next(function (err, key, value) {
      if (err) {
        iterator.end(noop)
        self.emit("error", err)
        return
      }
      if (key == null && value == null) {
        iterator.end(noop)
        self.push(null)
        return
      }

      var record = multibuffer.pack([key, value])
      self.push(record)
    })
  }

  return spigot(_read)
}
123592
function createOpenDBFunction (opts) {
  return function (name, version, description, size) {
    if (typeof sqlitePlugin !== 'undefined') {
      // The SQLite Plugin started deviating pretty heavily from the
      // standard openDatabase() function, as they started adding more features.
      // It's better to just use their "new" format and pass in a big ol'
      // options object. Also there are many options here that may come from
      // the PouchDB constructor, so we have to grab those.
      var sqlitePluginOpts = assign({}, opts, {
        name: name,
        version: version,
        description: description,
        size: size
      })
      return sqlitePlugin.openDatabase(sqlitePluginOpts)
    }

    // Traditional WebSQL API
    return openDatabase(name, version, description, size)
  }
}
517522
function createDatabase (name) {
  var deferred = q.defer();

  // Make sure the database location exists
  ready.then(function () {
    // Check if database exists
    fs.exists(globalConfig.db.location + name + '.db.json', function (exists) {
      if(exists) return deferred.resolve();

      // If database is non-existent, simply write an empty object as placeholder
      fs.writeFile(globalConfig.db.location + name + '.db.json', '{}', function (err) {
        if(err) return deferred.reject('Database couldn\'t create table');

        return deferred.resolve();
      });
    });
  }, function () {
    deferred.reject('Database couldn\'t instantiate');
  });

  return deferred.promise;
}
278101
def create_db(name, owner=None, encoding=u'UTF-8', template='template1',
              **kwargs):
    """"""

    flags = u''
    if encoding:
        flags = u'-E %s' % encoding
    if owner:
        flags = u'%s -O %s' % (flags, owner)
    if template and template != 'template1':
        flags = u'%s --template=%s' % (flags, template)
    sudo('createdb %s %s' % (flags, name), user='postgres', **kwargs)
324974
protected RocksDB openDatabase(String location, Options options) throws IOException, RocksDBException {
        File dir = new File(location);
        dir.mkdirs();
        return RocksDB.open(options, location);
    }
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
298719
function createSQLiteRecordStream(dbPaths, importPlace) {
  const sqliteStream = combinedStream.create();
  const sqliteStatement = importPlace ?
    SQLiteStream.findGeoJSONByPlacetypeAndWOFId(getPlacetypes(), importPlace) :
    SQLiteStream.findGeoJSONByPlacetype(getPlacetypes());

  dbPaths.forEach((dbPath) => {
    sqliteStream.append( (next) => {
      logger.info( `Loading ${path.basename(dbPath)} database from ${path.dirname(dbPath)}` );
      next(new SQLiteStream(dbPath, sqliteStatement));
    });
  });

  return sqliteStream;
}
622620
function Table(name, db, options) {
  this.name = name;
  this.db = db; // the name of the database
  this.options = options || {};
  this.options.primaryKey = this.options.primary_key || "id";
  this.documents = {};
  this.indexes = {}; // String -> FUNC terms
  this.indexes[this.options.primaryKey] = {
    //TODO Make me use TERMS
    //fn: function(doc) { return doc[name] },
    // 69=FUNC, 2=MAKE_ARRAY, 31=GET_FIELD, 10=VAR, 1=ARGUMENT_INDEX
    //TODO Use a uuid to avoid collision
    fn: [ 69, [ [ 2, [ 1 ] ], [ 31, [ [ 10, [ 1 ] ], this.options.primaryKey ] ] ] ],
    function: { /* TODO */ },
    geo: false,
    outdated: false,
    ready: true,
    multi: false
  };
  this.id = util.uuid();
  if (options.meta === true) {
    // meta table
    this.meta = true;
  }
}
144519
function connect(options) {
  // Default driver is MySQL.
  activeBackend = options.driver || 'mysql';

  // Save the connection options for later use.
  connectionOptions = options;

  if (activeBackend === 'mysql') {
    // Save a reference to the MySQL client object for later use.
    activeDb = mysql.createClient(options);

    if (activeDb !== null) {
      activeDb.on('error', function (err) {
        console.log(err);
      });
    }
  }

  return activeDb;
}
403497
def create_db():
    
    from flask_appbuilder.models.sqla import Model

    engine = current_app.appbuilder.get_session.get_bind(mapper=None, clause=None)
    Model.metadata.create_all(engine)
    click.echo(click.style("DB objects created", fg="green"))
1302399
function(db) {
		function merge(a_, b_, plv8, ERROR) {

			function copy_properties(o, a) {
				Object.keys(a).forEach(function(k) {
					o[k] = a[k];
				});
				return o;
			}

			function copy(a, b) {
				return copy_properties(copy_properties({}, a), b);
			}

			try {
				return copy(a_, b_);
			} catch (e) {
				plv8.elog(ERROR, e);
				return;
			}
		}
		return db.query('CREATE SCHEMA IF NOT EXISTS nopg')
			.query('CREATE OR REPLACE FUNCTION nopg.merge(a json, b json) RETURNS json LANGUAGE plv8 STABLE AS ' + NoPg._escapeFunction(merge,
				["a", "b", "plv8", "ERROR"]) );
	}