myddas
This commit is contained in:
		@@ -263,7 +263,7 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :-
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%% sqlite3
 | 
					%% sqlite3
 | 
				
			||||||
db_open(sqlite3,Connection,File,User,Password) :-
 | 
					db_open(sqlite3,Connection,File,User,Password) :-
 | 
				
			||||||
    absolute_file_name(File,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)),
 | 
					    '$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
 | 
				
			||||||
    c_sqlite3_connect(Db,User,Password,Con),
 | 
					    c_sqlite3_connect(Db,User,Password,Con),
 | 
				
			||||||
    set_value(Connection,Con).
 | 
					    set_value(Connection,Con).
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,7 +98,7 @@ db_import(Connection,RelationName,PredName0) :-
 | 
				
			|||||||
        get_value(Connection,Con),
 | 
					        get_value(Connection,Con),
 | 
				
			||||||
	table_arity( Con, ConType, RelationName, Arity ),
 | 
						table_arity( Con, ConType, RelationName, Arity ),
 | 
				
			||||||
	strip_module(PredName0, Module, PredName),
 | 
						strip_module(PredName0, Module, PredName),
 | 
				
			||||||
	not c_db_check_if_exists_pred(PredName,Arity,Module),
 | 
						\+ c_db_check_if_exists_pred(PredName,Arity,Module),
 | 
				
			||||||
	R=..[relation,PredName,Arity,RelationName],
 | 
						R=..[relation,PredName,Arity,RelationName],
 | 
				
			||||||
	% assert relation fact
 | 
						% assert relation fact
 | 
				
			||||||
	assert(Module:R),
 | 
						assert(Module:R),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -156,7 +156,7 @@ DBMS(datalog_show_tables)(Connection) :-
 | 
				
			|||||||
% DBMS(show_tables)/2
 | 
					% DBMS(show_tables)/2
 | 
				
			||||||
% gives the results of the SHOW TABLES statement
 | 
					% gives the results of the SHOW TABLES statement
 | 
				
			||||||
% by backtracking
 | 
					% by backtracking
 | 
				
			||||||
%#if sqlite3
 | 
					#if sqlite3
 | 
				
			||||||
DBMS(show_tables)(Connection,table(Table)) :-
 | 
					DBMS(show_tables)(Connection,table(Table)) :-
 | 
				
			||||||
	'$get_value'(Connection,Conn),
 | 
						'$get_value'(Connection,Conn),
 | 
				
			||||||
	SQL = 'SELECT name FROM sqlite_master WHERE type=\'table\' ORDER BY name',
 | 
						SQL = 'SELECT name FROM sqlite_master WHERE type=\'table\' ORDER BY name',
 | 
				
			||||||
@@ -165,7 +165,7 @@ DBMS(show_tables)(Connection,table(Table)) :-
 | 
				
			|||||||
	c_DBMS(query)(SQL,ResultSet,Conn,Mode,_),
 | 
						c_DBMS(query)(SQL,ResultSet,Conn,Mode,_),
 | 
				
			||||||
	!,
 | 
						!,
 | 
				
			||||||
	DBMS(row)(ResultSet,1,[Table]).
 | 
						DBMS(row)(ResultSet,1,[Table]).
 | 
				
			||||||
%#endif
 | 
					#endif
 | 
				
			||||||
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -487,7 +487,7 @@ b_getval(GlobalVariable, Val) :-
 | 
				
			|||||||
	b_setval('$spy_glist',[]),
 | 
						b_setval('$spy_glist',[]),
 | 
				
			||||||
	'$disable_debugging'.
 | 
						'$disable_debugging'.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
'$debug_restart'(state(Trace, Debug, State, SPY_GN, GList)) :-
 | 
					'$debug_restore'(state(Trace, Debug, State, SPY_GN, GList)) :-
 | 
				
			||||||
	b_setval('$spy_glist',GList),
 | 
						b_setval('$spy_glist',GList),
 | 
				
			||||||
	b_setval('$spy_gn',SPY_GN),
 | 
						b_setval('$spy_gn',SPY_GN),
 | 
				
			||||||
	set_prolog_flag(debug, Debug),
 | 
						set_prolog_flag(debug, Debug),
 | 
				
			||||||
@@ -520,7 +520,7 @@ break :-
 | 
				
			|||||||
        NBL is BL+1,
 | 
					        NBL is BL+1,
 | 
				
			||||||
	set_prolog_flag(break_level, NBL ),
 | 
						set_prolog_flag(break_level, NBL ),
 | 
				
			||||||
	format(user_error, '% Break (level ~w)~n', [NBL]),
 | 
						format(user_error, '% Break (level ~w)~n', [NBL]),
 | 
				
			||||||
	'$do_live',
 | 
						live,
 | 
				
			||||||
	!,
 | 
						!,
 | 
				
			||||||
	set_value('$live','$true'),
 | 
						set_value('$live','$true'),
 | 
				
			||||||
        '$debug_restore'(DState),
 | 
					        '$debug_restore'(DState),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,22 +109,16 @@ error_handler(Error, Level) :-
 | 
				
			|||||||
'$process_error'('$forward'(Msg),  _) :-
 | 
					'$process_error'('$forward'(Msg),  _) :-
 | 
				
			||||||
	!,
 | 
						!,
 | 
				
			||||||
	throw( '$forward'(Msg) ).
 | 
						throw( '$forward'(Msg) ).
 | 
				
			||||||
'$process_error'(abort, Level) :-
 | 
					'$process_error'(error(event(abort,I),C), Level) :-
 | 
				
			||||||
	!,
 | 
						!,
 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
 | 
					  current_prolog_flag(break_level, 0),
 | 
				
			||||||
	 Level \== top
 | 
						 Level \== top
 | 
				
			||||||
	->
 | 
					 | 
				
			||||||
	 throw( abort )
 | 
					 | 
				
			||||||
	;
 | 
					 | 
				
			||||||
	 current_prolog_flag(break_level, 0)
 | 
					 | 
				
			||||||
	->
 | 
						->
 | 
				
			||||||
    print_message(informational,abort(user)),
 | 
					    print_message(informational,abort(user)),
 | 
				
			||||||
 	 fail
 | 
					 	 fail
 | 
				
			||||||
 	;
 | 
					 	;
 | 
				
			||||||
	 current_prolog_flag(break_level, I0),
 | 
						 throw( error(event(abort,I),C) )
 | 
				
			||||||
	 I is I0-1,
 | 
					 | 
				
			||||||
	 current_prolog_flag(break_level, I),
 | 
					 | 
				
			||||||
	 throw(abort)
 | 
					 | 
				
			||||||
	).
 | 
						).
 | 
				
			||||||
'$process_error'(error(permission_error(module,redefined,A),B), Level) :-
 | 
					'$process_error'(error(permission_error(module,redefined,A),B), Level) :-
 | 
				
			||||||
        Level \= top, !,
 | 
					        Level \= top, !,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user