typos/ro
This commit is contained in:
@@ -202,7 +202,7 @@ user:file_search_path(dataset, '.').
|
||||
|
||||
:- dynamic user:prolog_file_type/2.
|
||||
|
||||
user:prolog_file_type( db, myddas ).
|
||||
user:prolog_file_type( db, dataset ).
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% db_open/5
|
||||
@@ -213,7 +213,7 @@ user:prolog_file_type( db, myddas ).
|
||||
%% @pred db_open(+Interface,-Handle,+HostDb,+User,+Password)
|
||||
%% @pred db_open(+Interface,+HostDb,+User,+Password)
|
||||
%
|
||||
% Connect to a database-server, or open a file as a database, Paraameters are:
|
||||
% Connect to a database-server, or open a file as a database, Parameters are:
|
||||
%
|
||||
% _Interface_ : a supported server, it may be one of mysql, odbc, postgres, sqlite3.
|
||||
% _Handle_ : a name that refers to the database-conectionn. By default is `myddas`,
|
||||
@@ -225,7 +225,7 @@ user:prolog_file_type( db, myddas ).
|
||||
%
|
||||
db_open(Interface,HostDb,User,Password):-
|
||||
db_open(Interface,myddas,HostDb,User,Password).
|
||||
|
||||
|
||||
#ifdef MYDDAS_MYSQL
|
||||
db_open(mysql,Connection,Host/Db/Port/Socket,User,Password) :- !,
|
||||
'$error_checks'(db_open(mysql,Connection,Host/Db/Port/Socket,User,Password)),
|
||||
@@ -263,7 +263,7 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :-
|
||||
|
||||
%% sqlite3
|
||||
db_open(sqlite3,Connection,File,User,Password) :-
|
||||
absolute_file_name(File,Db,[extensions(db),access(write),file_type(myddas),expand(true)]),
|
||||
absolute_file_name(File,Db,[,access(write),file_type(myddas),expand(true)]),
|
||||
'$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
|
||||
c_sqlite3_connect(Db,User,Password,Con),
|
||||
set_value(Connection,Con).
|
||||
|
@@ -7,27 +7,27 @@
|
||||
|
||||
:- begin_tests(sqlite3).
|
||||
|
||||
%:- if( yap_flag(android,true) ).
|
||||
%test(open) :-
|
||||
% db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
|
||||
%:- else.
|
||||
test(open) :-
|
||||
db_open(sqlite3,dataset('chinook'),_,_).
|
||||
%:-endif.
|
||||
:- if( current_prolog_flag(android,true) ).
|
||||
test(db_open) :-
|
||||
db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
|
||||
:- else.
|
||||
test(db_open) :-
|
||||
db_open(sqlite3,con,dataset('chinook.db'),_,_).
|
||||
:-endif.
|
||||
|
||||
test(schema0, all((Tables ==[(table albums),
|
||||
(table artists),
|
||||
(table customers),
|
||||
(table employees),
|
||||
(table genres),
|
||||
(table invoice_items),
|
||||
(table invoices),
|
||||
(table media_types),
|
||||
(table playlist_track),
|
||||
(table playlists),
|
||||
(table sqlite_sequence),
|
||||
(table sqlite_stat1),(table tracks)]))) :-
|
||||
findall( Desc, db_show_tables(Desc), Tables).
|
||||
test(schema0, all((Desc ==[(albums),
|
||||
(artists),
|
||||
(customers),
|
||||
(employees),
|
||||
(genres),
|
||||
(invoice_items),
|
||||
(invoices),
|
||||
(media_types),
|
||||
(playlist_track),
|
||||
(playlists),
|
||||
(sqlite_sequence),
|
||||
(sqlite_stat1),(tracks)]))) :-
|
||||
db_show_tables(con,Desc).
|
||||
|
||||
test(import) :-
|
||||
db_import('artists', artists),
|
||||
|
Reference in New Issue
Block a user