gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnue-dev] Quoting table names & value type and database dependend v


From: Jan Ischebeck
Subject: Re: [Gnue-dev] Quoting table names & value type and database dependend value formating for SQL dbDriver
Date: Wed, 12 Jun 2002 23:47:59 +0200
User-agent: Mutt/1.4i

I have to correct myself, value -> string conversions are already done
by the function toSqlString(), which could be overwriten by single 
DBdriver.py's. But this doesn't solve the fieldname problem.

On Wed, Jun 12, 2002 at 06:53:18PM +0200, Jan Ischebeck wrote:
> 
> 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 mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gnue-dev
> 

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]