[CalendarServer-changes] [6968] CalendarServer/branches/users/glyph/dalify/twext/enterprise/dal/ syntax.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 16 06:32:56 PST 2011


Revision: 6968
          http://trac.macosforge.org/projects/calendarserver/changeset/6968
Author:   glyph at apple.com
Date:     2011-02-16 06:32:55 -0800 (Wed, 16 Feb 2011)
Log Message:
-----------
support for 'default' keyword in an Insert.  (Not really enough here to test, even, so including an explanation.)

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/dalify/twext/enterprise/dal/syntax.py

Modified: CalendarServer/branches/users/glyph/dalify/twext/enterprise/dal/syntax.py
===================================================================
--- CalendarServer/branches/users/glyph/dalify/twext/enterprise/dal/syntax.py	2011-02-16 14:32:44 UTC (rev 6967)
+++ CalendarServer/branches/users/glyph/dalify/twext/enterprise/dal/syntax.py	2011-02-16 14:32:55 UTC (rev 6968)
@@ -775,5 +775,16 @@
         return 'Parameter(%r)' % (self.name,)
 
 
-# Common helpers.
+# Common helpers:
+
+# current timestamp in UTC format.
 utcNowSQL = Function('timezone')('UTC', NamedValue('CURRENT_TIMESTAMP'))
+
+# You can't insert a column with no rows.  In SQL that just isn't valid syntax,
+# and in this DAL you need at least one key or we can't tell what table you're
+# talking about.  Luckily there's the 'default' keyword to the rescue, which, in
+# the context of an INSERT statement means 'use the default value explicitly'.
+# (Although this is a special keyword in a CREATE statement, in an INSERT it
+# behaves like an expression to the best of my knowledge.)
+default = NamedValue('default')
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110216/45b38a4b/attachment.html>


More information about the calendarserver-changes mailing list