This library serves two purposes. First, term structures can be used to interact with SQL databases and second, to provide a common abstraction layer for ODBC and proSQLite libraries of SWI-Prolog.
This library is debug/1 aware: call debug(db_facts) to see what is sent to
the SQL engine.
date(Y,M,D) term.
?- db_version( 0:5:0, date(2018,3,18) ). true.
db_create( phones_db, phones(name+text,telephone-text,address-text) )
db_assert( Conn, Goal, _Aff ) for the
implied connection Conn for table that corresponds
to the supplied Goal.db_assert( Conn, Goal, Affected ) for the
implied connection Conn for table that corresponds
to the supplied Goal.As of db_facts v0.2 Goal can be a list of Goals with all goals asserted in a single Instert operation.
Call db_holds( Conn, Goal ) for the
implied connection Conn for table that corresponds
to the supplied Goal.
db_retractall(Conn,Goal,_Aff) for the
implied connection Conn for table that corresponds
to the supplied Goal.db_retractall(Conn,Goal,Affected) for the
implied connection Conn for table that corresponds
to the supplied Goal.
db_retractall( uniprot, secondary_accessions(_,'P64943'), A ).