As it happens, this works on the Sybase dialect without fixing the
quoting at all! Apparently SQL such as this is happily accepted by
Sybase:
SELECT [fdcommon.dbo].organization.org_id,
[fdcommon.dbo].organization.abbrev
FROM [fdcommon.dbo].organization JOIN [fdcommon.dbo].org_type
ON [fdcommon.dbo].org_type.org_type_id =
[fdcommon.dbo].organization.org_type
I resorted to some brute-force list operations rather than regular
expressions to parse out the component names (see diff below). I will
fix the quoting shortly (within the next day or so) and submit a
single diff.
thanks,
pjjH
Index: schema.py
===================================================================
--- schema.py (revision 5816)
+++ schema.py (working copy)
@@ -876,17 +876,22 @@
raise exc.ArgumentError(
"Parent column '%s' does not descend from a "
"table-attached Column" % str(self.parent))
- m = re.match(r"^(.+?)(?:\.(.+?))?(?:\.(.+?))?$",
self._colspec,
- re.UNICODE)
+ m = self._colspec.split('.')
if m is None:
raise exc.ArgumentError(
"Invalid foreign key column specification: %s" %
self._colspec)
- if m.group(3) is None:
- (tname, colname) = m.group(1, 2)
+
+ m.reverse()
+ (colname, tname) = m[0:2]
+
+ if m[2] is None:
schema = None
else:
- (schema, tname, colname) = m.group(1, 2, 3)
+ m1 = m[2:]
+ m1.reverse()
+ schema = '.'.join(m1)
+
On Mar 5, 7:21 pm, "
phrrn...@googlemail.com" <
phrrn...@googlemail.com>
wrote: