My guess is that some engines could allow insertion of a blank record
and different versions of the same engine may behave differently.
Although a more graceful error would be nice, we should let the
database fail on this one.

On May 12, 2:53 pm, Jim Karsten <[email protected]> wrote:
> Here are two possible solutions, both for gluon.dal.py:
>
> class BaseAdapter(ConnectionPool):
>
> def insert(self,table,fields):
> if not fields:
> raise SyntaxError, 'No fields to insert'
> query = self._insert(table,fields)
> ...
> return rid
>
> or
>
> class SQLiteAdapter(BaseAdapter):
>
> def insert(self,table,fields):
> if not fields:
> raise SyntaxError, 'No fields to insert'
> return BaseAdaptor.insert(self, table, fields)
>
> The first will affect all dbengines. The second is SQLite specific but there
> may be other dbengines that would benefit from that fix as well.

Reply via email to