sqltypes (library)
Usage and interface
- Library usage:
:- use_module(library(sqltypes)). - Exports:
- Predicates:
accepted_type/2, get_type/2, type_compatible/2, type_union/3, sybase2sqltypes_list/2, sybase2sqltype/2, postgres2sqltypes_list/2, postgres2sqltype/2. - Regular Types:
sqltype/1, sybasetype/1, postgrestype/1.
- Predicates:
- Imports:
Documentation on exports
sqltype(int). sqltype(flt). sqltype(num). sqltype(string). sqltype(date). sqltype(time). sqltype(datetime).
These types have the same meaning as the corresponding standard types in the basictypes library.
Usage:sqltype(Type)
Type is an SQL data type supported by the translator.
Usage:accepted_type(SystemType,NativeType)
For the moment, tests wether the SystemType received is a sybase or a postgres type (in the future other systems should be supported) and obtains its equivalent NativeType sqltype.
- Call and exit should be compatible with:
(sqltypes:sybasetype/1)SystemType is an SQL data type supported by Sybase.
(sqltypes:sqltype/1)NativeType is an SQL data type supported by the translator.
Usage:get_type(Constant,Type)
Prolog implementation-specific definition of type retrievals. CIAO Prolog version given here (ISO).
- Call and exit should be compatible with:
(basic_props:term/1)Constant is any term.
(sqltypes:sqltype/1)Type is an SQL data type supported by the translator. - The following properties should hold at call time:
(term_typing:nonvar/1)Constant is currently a term which is not a free variable.
Usage:type_compatible(TypeA,TypeB)
Checks if TypeA and TypeB are compatible types, i.e., they are the same or one is a subtype of the other.
- Call and exit should be compatible with:
(sqltypes:sqltype/1)TypeA is an SQL data type supported by the translator.
(sqltypes:sqltype/1)TypeB is an SQL data type supported by the translator.
Usage:type_union(TypeA,TypeB,Union)
Union is the union type of TypeA and TypeB.
- Call and exit should be compatible with:
(sqltypes:sqltype/1)TypeA is an SQL data type supported by the translator.
(sqltypes:sqltype/1)TypeB is an SQL data type supported by the translator.
(sqltypes:sqltype/1)Union is an SQL data type supported by the translator.
sybasetype(integer). sybasetype(numeric). sybasetype(float). sybasetype(double). sybasetype(date). sybasetype(char). sybasetype(varchar). sybasetype('long varchar'). sybasetype(binary). sybasetype('long binary'). sybasetype(timestamp). sybasetype(time). sybasetype(tinyint).
Usage:sybasetype(Type)
Type is an SQL data type supported by Sybase.
Usage:sybase2sqltypes_list(SybaseTypesList,SQLTypesList)
SybaseTypesList is a list of Sybase SQL types. PrologTypesList contains their equivalent SQL-type names in CIAO.
- The following properties should hold upon exit:
(basic_props:list/1)SybaseTypesList is a list.
(basic_props:list/1)SQLTypesList is a list.
Usage:sybase2sqltype(SybaseType,SQLType)
SybaseType is a Sybase SQL type name, and SQLType is its equivalent SQL-type name in CIAO.
- The following properties should hold upon exit:
(sqltypes:sybasetype/1)SybaseType is an SQL data type supported by Sybase.
(sqltypes:sqltype/1)SQLType is an SQL data type supported by the translator.
postgrestype(int2). postgrestype(int4). postgrestype(int8). postgrestype(float4). postgrestype(float8). postgrestype(date). postgrestype(timestamp). postgrestype(time). postgrestype(char). postgrestype(varchar). postgrestype(text). postgrestype(bool).
Usage:postgrestype(Type)
Type is an SQL data type supported by postgres.
Usage:postgres2sqltypes_list(PostgresTypesList,SQLTypesList)
PostgresTypesList is a list of postgres SQL types. PrologTypesList contains their equivalent SQL-type names in CIAO.
- The following properties should hold upon exit:
(basic_props:list/1)PostgresTypesList is a list.
(basic_props:list/1)SQLTypesList is a list.
Usage:postgres2sqltype(PostgresType,SQLType)
PostgresType is a postgres SQL type name, and SQLType is its equivalent SQL-type name in CIAO.
- The following properties should hold upon exit:
(sqltypes:postgrestype/1)PostgresType is an SQL data type supported by postgres.
(sqltypes:sqltype/1)SQLType is an SQL data type supported by the translator.