Skip to content

Release 0.1.5

Compare
Choose a tag to compare
@sripathikrishnan sripathikrishnan released this 09 Nov 15:24
· 48 commits to master since this release

The major feature is support for multiple param styles. Per PEP-249, database libraries can support 5 different styles of parameter types. These are :

  1. format ANSI C printf format codes, e.g. ...WHERE name=%s. This is the default style.
  2. qmark Question mark style, e.g. ...WHERE name=?
  3. numeric Numeric, positional style, e.g. ...WHERE name=:1
  4. named Named style, e.g. ...WHERE name=:name
  5. pyformat Python extended format codes, e.g. ...WHERE name=%(name)s

You can specify the param_style by passing it to the constructor like this

jinja = JinjaSql(param_style='qmark')

Note that named and pyformat are special. The bind_parameters object returned by prepare_query will be a dictionary. For all other param styles, the bind_parameters object will be a list.

Other Changes

  1. Added support for declarative tests via a YAML configuration file
  2. Dropped support for python 2.6.x. This is because ordereddict is not available in python 2.6.x. Although workaround exist to add orderedict to python 2.6.x, the special handling wasn't worth it. If required, this can be added back fairly easily.