[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnue-dev] Quoting table names & value type and database dependend value
From: |
Jan Ischebeck |
Subject: |
[Gnue-dev] Quoting table names & value type and database dependend value formating for SQL dbDriver |
Date: |
Wed, 12 Jun 2002 18:53:18 +0200 |
User-agent: |
Mutt/1.4i |
I have two ideas too make the forms client a bit more flexible in
case of special fieldnames and special (non 100% ANSI SQL conform) data
types (like the POSTGRESQL Numeric == Float issuse).
1.
names of tables and columnns should be quoted to allow names to
contain a) special characters and b) non-ascii characters
c) reserved words
(this should be usefull for both old and new table designs.)
2.
make SQL creation more flexible by moving fieldname/dbname->quoutet
string (see 1,) and value -> string conversions into seperate functions
in the _dbsig/driver. by this way database drivers could just overwrite
this functions instead of having to overwrite the whole SQL generation
functions.
Example:
-- code taken from common/src/dbdriver/_dbsig/DBdriver.py
return "INSERT INTO %s (%s) VALUES (%s)" % \
(self._parent._dataObject.table, string.join(fields,','), \
string.join(vals,',') )
----------------------------------------------------------
-- proposed code changes ----------------------------------
return "INSERT INTO %s (%s) VALUES (%s)" % \
(self._parent._dataObject.table,
string.join(self.quoteFields(fields),','), \
string.join(self.quoteValues(vals),',') )
-----------------------------------------------------------
Jan Ischebeck
address@hidden
J.I. e-Services
- [Gnue-dev] Quoting table names & value type and database dependend value formating for SQL dbDriver,
Jan Ischebeck <=