Skip to contents


db_schema_create() creates a schema on the database.


db_schema_create(con, schema, ...)



An object of class "src" or "DBIConnection".


Class character or SQL (cf. Details), name of the schema


Passed on to the individual methods.


NULL invisibly.


Methods are not available for all DBMS.

An error is thrown if a schema of that name already exists.

The argument schema (and dbname for MSSQL) can be provided as SQL objects. Keep in mind, that in this case it is assumed that they are already correctly quoted as identifiers using DBI::dbQuoteIdentifier().

Additional arguments are:

  • dbname: supported for MSSQL. Create a schema in a different database on the connected MSSQL-server; default: database addressed by con.

See also

Other schema handling functions: db_schema_drop(), db_schema_exists(), db_schema_list()