コード例 #1
0
ファイル: compiler.py プロジェクト: AntonNguyen/easy_api
    def visit_insert(self, insert_stmt):
        self.isinsert = True
        colparams = self._get_colparams(insert_stmt)
        preparer = self.preparer

        insert = ' '.join(["INSERT"] +
                          [self.process(x) for x in insert_stmt._prefixes])

        if not colparams and not self.dialect.supports_default_values and not self.dialect.supports_empty_insert:
            raise exc.NotSupportedError(
                "The version of %s you are using does not support empty inserts." % self.dialect.name)
        elif not colparams and self.dialect.supports_default_values:
            return (insert + " INTO %s DEFAULT VALUES" % (
                (preparer.format_table(insert_stmt.table),)))
        else: 
            return (insert + " INTO %s (%s) VALUES (%s)" %
                (preparer.format_table(insert_stmt.table),
                 ', '.join([preparer.format_column(c[0])
                           for c in colparams]),
                 ', '.join([c[1] for c in colparams])))
コード例 #2
0
ファイル: sybase.py プロジェクト: AntonNguyen/easy_api
 def get_col_spec(self):
     raise exc.NotSupportedError("Data type not supported")
コード例 #3
0
ファイル: sybase.py プロジェクト: AntonNguyen/easy_api
 def process(value):
     raise exc.NotSupportedError("Data type not supported", [value])