primary key columns are null (i.e. when mapping to outer joins etc)
- fixed reflection of foreign keys to autoload the referenced table
if it was not loaded already
+- [ticket:256] - pass URL query string arguments to connect() function
0.2.6
- big overhaul to schema to allow truly composite primary and foreign
if opts.get('port'):
opts['host'] = "%s/%s" % (opts['host'], opts['port'])
del opts['port']
+ opts.update(url.query)
+ # pop arguments that we took at the module level
+ opts.pop('type_conv', None)
+ opts.pop('concurrency_level', None)
self.opts = opts
return ([], self.opts)
def create_connect_args(self, url):
self.opts = url.translate_connect_args(['host', 'database', 'user', 'password', 'port'])
+ self.opts.update(url.query)
return ([], self.opts)
def connect_args(self):
def create_connect_args(self, url):
opts = url.translate_connect_args(['host', 'db', 'user', 'passwd', 'port'])
+ opts.update(url.query)
+ def coercetype(param, type):
+ if param in opts and type(param) is not type:
+ if type is bool:
+ opts[param] = bool(int(opts[param]))
+ else:
+ opts[param] = type(opts[param])
+ coercetype('compress', bool)
+ coercetype('connect_timeout', int)
+ coercetype('use_unicode', bool) # this could break SA Unicode type
+ coercetype('charset', str) # this could break SA Unicode type
+ # TODO: what about options like "ssl", "cursorclass" and "conv" ?
return [[], opts]
def create_execution_context(self):
dsn = dsn,
threaded = self.threaded
)
+ opts.update(url.query)
return ([], opts)
def type_descriptor(self, typeobj):
opts['port'] = int(opts['port'])
else:
opts['port'] = str(opts['port'])
+ opts.update(url.query)
return ([], opts)
def create_execution_context(self):
return SQLiteSchemaGenerator(*args, **kwargs)
def create_connect_args(self, url):
filename = url.database or ':memory:'
- return ([filename], {})
+ return ([filename], url.query)
def type_descriptor(self, typeobj):
return sqltypes.adapt_type(typeobj, colspecs)
def create_execution_context(self):