mcfunley / pugsql

A HugSQL-inspired database library for Python
https://pugsql.org
Apache License 2.0
673 stars 22 forks source link

`disconnect` et al are illegal names for queries #28

Closed mcfunley closed 4 years ago

mcfunley commented 4 years ago

Methods already defined on the Module class can't be used as query names. disconnect is one example.

The exception when you try this isn't helpful:

...
  File "/Users/dmckinley/.pyenv/versions/duesbot/lib/python3.7/site-packages/pugsql/compiler.py", line 50, in __init__
    sqlfile, s.name, self._statements[s.name].filename))
KeyError: 'disconnect'

The exception clause is assuming there's a conflict with a query. Need to update this to explain that the method names are reserved.