1.8.5 CQL: Schema
These define the schema. You MUST either define them, or include
library(cql/cql_autoschema)
and add two directives to build
the schema automatically:
:-
register_database_connection_details(+Schema, +ConnectionInfo)
.:-
build_schema(+Schema)
.
Otherwise, you need to define at least cql:default_schema/1 and cql:dbms/2, and then as many of the other facts as needed for your schema.
- cql:
default_schema(-Schema)
MUST be defined. CQL autoschema will define this for you if you use it. - cql:
dbms(+Schema, -DBMS)
MUST be defined for every schema you use. CQL autoschema will define this for you if you use it. DBMS must be one of the following:- ’Microsoft SQL Server'
- ’PostgreSQL'
- ’SQLite'
- cql:
odbc_data_type(+Schema, +TableName, +ColumnName, +OdbcDataType)
. - cql:
primary_column_name(+Schema, +Tablename, +ColumnName)
. - cql:database_attribute(+EntityType:table/view, +Schema:atom,
+EntityName:atom, +ColumnName:atom, +DomainOrNativeType:atom,
+AllowsNulls:
allows_nulls(true/false)
, +IsIdentity:is_identity(true/false)
, +ColumnDefault). - cql:
database_domain(+DomainName, +OdbcDataType)
. - cql:
routine_return_type(+Schema, +RoutineName, +OdbcDataType)
. - cql:
database_constraint(+Schema, +EntityName, +ConstraintName, +Constraint)
.