|
|
/*************************************************************************** sqlcommands.h - description ------------------- begin : Sun Jan 27 2002 copyright : (C) 2002 by Raoul Markus email : raoul.markus@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef xqlsqlstmt_h #define xqlsqlstmt_h /* this are the system tables for xql */ #define XQL_DROP_T_OBJECT "drop table xqlobject" #define XQL_INIT_T_OBJECT "create table xqlobject (id int, type varchar(60))" #define XQL_DROP_T_OBJATT "drop table xqlobj_attr" #define XQL_INIT_T_OBJATT "create table xqlobj_attr (type varchar(60), attr_type varchar(60), classname varchar(60),pos int)" #define XQL_DROP_T_OBJTYP "drop table xqlobjecttypes" #define XQL_INIT_T_OBJTYP "create table xqlobjecttypes (type varchar(60), simple int, num_attr int)" #define XQL_DROP_T_OBJATI "drop table xqlobj_attr_id" #define XQL_INIT_T_OBJATI "create table xqlobj_attr_id (id int, attr_id int, pos int)" /* xqltypes stores all information about a certain type attention: simple and num_subtypes are also stored indirectly in xqlsubtypes. data cohrence has to be garded. */ #define XQL_DROP_T_XQLTYP "drop table xqltypes" #define XQL_INIT_T_XQLTYP "create table xqltypes (id int, type varchar(60), classname varchar(60), simple int, num_subtypes int)" /** xqlsubtypes relates types */ #define XQL_DROP_T_XQLSUBT "drop table xqlsubtypes" #define XQL_INIT_T_XQLSUBT "create table xqlsubtypes (id int, sub_id int, pos int)" /** xqlinstances relates instance-ids to types (id) */ #define XQL_DROP_T_XQLINST "drop table xqlinstances" #define XQL_INIT_T_XQLINST "create table xqlinstances (id int, inst_id int)" /** xqlobjicons relates object or type ids ids to icons */ #define XQL_DROP_T_XQLOBJICON "drop table xqlobjicons" #define XQL_INIT_T_XQLOBJICON "create table xqlobjicons (id int, iconid int)" /** every type creates a own table of the form if id points to a simple type: xql[id] (inst_id int, value sqltype(classname)); if id points to a non-simple type: xql[id] (inst_id int, sub_inst_id int, pos int) where id is the type-id of the given type. */ #define XQL_DROP_T_XQLTPID "drop table xqltypeids" #define XQL_INIT_T_XQLTPID "create table xqltypeids (id int)" #define XQL_DROP_T_XQLINID "drop table xqlinstids" #define XQL_INIT_T_XQLINID "create table xqlinstids (id int)" #define XQL_DROP_T_XQLFIID "drop table xqlfileids" #define XQL_INIT_T_XQLFIID "create table xqlfileids (id int)" #define XQL_DROP_T_XQLUSRS "drop table xqlusers" #define XQL_INIT_T_XQLUSRS "create table xqlusers (id int, name varchar(60), passwd varchar(60)) " #define XQL_INIT_DB_XQLUSR1 "insert into xqltypes (id, type, classname, simple, num_subtypes) values (1,'xqlUser','xqlUser',1,0) " #define XQL_INIT_DB_XQLUSR2 "insert into xqltypeids (id) values (1)" #define XQL_DROP_T_XQLICONS "drop table xqlbinobjs" #define XQL_INIT_T_XQLICONS "create table xqlbinobjs (id int, line int, data long varbinary) " /* define the tables for store and files */ #define XQL_DROP_T_XQLSTORE "drop table xqlstores" #define XQL_INIT_T_XQLSTORE "create table xqlstores (id int, server varchar(60), user varchar(60), passwd varchar(60), directory varchar(255)) " #define XQL_INIT_DB_XQLSTORE1 "insert into xqltypes (id, type, classname, simple, num_subtypes) values (2,'xqlStore','xqlStore',1,0) " #define XQL_INIT_DB_XQLSTORE2 "insert into xqltypeids (id) values (1)" #define XQL_DROP_T_XQLFILES "drop table xqlfiles" #define XQL_INIT_T_XQLFILES "create table xqlfiles (id int, store int, filename varchar(255), sfilename varchar(255)) " /** Userobject related sql-statements */ #define XQL_SQL_LOAD_USERNM "select name from xqlusers where id = %i" #define XQL_SQL_LOAD_USERPW "select passwd from xqlusers where id = %i" #define XQL_SQL_GETID_BY_NAME "select id from xqlusers where name = '%s'" #define XQL_SQL_CREAT_USER "insert into xqlusers (id, name, passwd) values (%i, '%s', '%s')" #define XQL_SQL_UPDATE_USER "update xqlusers set name='%s', passwd='%s' where id = %i" /** objectrelated sql-statements */ #define XQL_SQL_GET_TYPE_BY_NAME "select id from xqltypes where type = '" #endif
Generated by: markus on hobbes on Fri Mar 29 16:15:24 2002, using kdoc 2.0a53. |