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
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)
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