示例#1
0
文件: postgres.py 项目: andgein/pony
 def INSERT(builder, table_name, columns, values, returning=None):
     if not values:
         result = [
             'INSERT INTO ',
             builder.quote_name(table_name), ' DEFAULT VALUES'
         ]
     else:
         result = SQLBuilder.INSERT(builder, table_name, columns, values)
     if returning is not None:
         result.extend([' RETURNING ', builder.quote_name(returning)])
     return result
示例#2
0
文件: sqlite.py 项目: rlizana/pony
 def INSERT(builder, table_name, columns, values, returning=None):
     if not values:
         return 'INSERT INTO %s DEFAULT VALUES' % builder.quote_name(
             table_name)
     return SQLBuilder.INSERT(builder, table_name, columns, values,
                              returning)
示例#3
0
 def INSERT(builder, table_name, columns, values, returning=None):
     result = SQLBuilder.INSERT(builder, table_name, columns, values)
     if returning is not None:
         result.extend((' RETURNING ', builder.quote_name(returning),
                        ' INTO :new_id'))
     return result