X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-postgresql-socket3%2Fsql.lisp;h=7f545c80ee63eb4124ed9eb07ff9a53199286e8d;hb=9347205f5d899b30b8bb4429bf47ae59709c14d7;hp=e2515005cb5cda828bd910484cb89d7d94e8dba2;hpb=8e643f3af7018f5023ef3d6e7aa56c65d4781958;p=clsql.git diff --git a/db-postgresql-socket3/sql.lisp b/db-postgresql-socket3/sql.lisp index e251500..7f545c8 100644 --- a/db-postgresql-socket3/sql.lisp +++ b/db-postgresql-socket3/sql.lisp @@ -333,4 +333,20 @@ (defmethod read-sql-value (val (type (eql 'generalized-boolean)) (database postgresql-socket3-database) db-type) (declare (ignore database db-type)) - val) \ No newline at end of file + val) + +(defmethod clsql-sys::%table-exists-p (name (database postgresql-socket3-database) &key owner ) + (unless database (setf database *default-database*)) + (when (clsql:query (command-object "SELECT 1 FROM information_schema.tables WHERE table_name=$1 and ($2::text IS NULL or table_schema = $2::text)" + (list name owner)) + :flatp T + :database database) + T)) + +(defmethod database-list-tables ((database postgresql-socket3-database) &key owner) + (clsql:query (command-object " +SELECT table_name FROM information_schema.tables + WHERE ($1::Text IS NULL or table_schema = $1::text)" + (list (or owner :null))) + :flatp T + :database database))