Changeset 900 for trunk/pg.py


Ignore:
Timestamp:
Dec 31, 2016, 3:40:24 AM (3 years ago)
Author:
cito
Message:

Allow query_formatted() to be used without parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pg.py

    r894 r900  
    678678        return params
    679679
    680     def format_query(self, command, values, types=None, inline=False):
     680    def format_query(self, command, values=None, types=None, inline=False):
    681681        """Format a database query using the given values and types."""
     682        if not values:
     683            return command, []
    682684        if inline and types:
    683685            raise ValueError('Typed parameters must be sent separately')
     
    18481850        return self.db.query(command)
    18491851
    1850     def query_formatted(self, command, parameters, types=None, inline=False):
     1852    def query_formatted(self, command,
     1853            parameters=None, types=None, inline=False):
    18511854        """Execute a formatted SQL command string.
    18521855
Note: See TracChangeset for help on using the changeset viewer.