new pydal

73 views
Skip to first unread message

Massimo DiPierro

unread,
May 26, 2026, 8:59:52 PMMay 26
to py4web
I released the new pydal mostly rewritten by Claude. Please help me test it in case it messed up badly. 

Alan Etkin

unread,
May 31, 2026, 9:19:39 AM (14 days ago) May 31
to py4web
Great! Will test and report any issue

Christian Varas

unread,
May 31, 2026, 11:08:04 AM (14 days ago) May 31
to Alan Etkin, py4web

This is great news. AI models are incredibly helpful for refactoring code and identifying bugs.

I was wondering if this new version introduces new features, or if the focus is primarily on bug fixes and internal refactoring? Additionally, are there any other major benefits we can expect with this release?

In either case, it looks like a fantastic update.

greetings 
--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/py4web/70d94c9f-243c-4773-8e67-b6c789ee0c10n%40googlegroups.com.

Massimo DiPierro

unread,
May 31, 2026, 12:04:00 PM (14 days ago) May 31
to Christian Varas, Alan Etkin, py4web
Good question. It does:

- There is a new db(..).nested_select() method
- It has the ability to generate SQL for any backend without a driver or a connection.

There is. Section about each in the readme.

Massimo





Alan Etkin

unread,
Jun 2, 2026, 6:32:07 PM (11 days ago) Jun 2
to py4web
I'm trying the subquery feature but .subselect throws an error saying the command is not available for a Set object. Attached the output of the shell

Regards

Alan
subselect_error.txt

Massimo DiPierro

unread,
Jun 2, 2026, 7:24:54 PM (11 days ago) Jun 2
to Alan Etkin, py4web
I think it should be 

db(db.mytable.atext.contains("hola")).nested_select(db.mytable.id)

Alan Etkin

unread,
Jun 2, 2026, 8:00:05 PM (11 days ago) Jun 2
to py4web
the docs say that .subselect is supported. Changing to .nested_select works ok

However, if you make a trivial subquery like:

sub = db(db.pet.name.contains("f")).nested_select(db.pet.id)
rows = db(db.pet.id.belongs(sub)).select()
for row in rows:
print(row.name)

It crashes with this traceback

Traceback (most recent call last):
  File "/home/alan-etkin/Pruebas/test_case_subqueries.py", line 25, in <module>
    rows = db(db.pet.id.belongs(sub)).select()
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/objects.py", line 2971, in select
    return adapter.select(self.query, fields, attributes)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/adapters/sqlite.py", line 91, in select
    return super(SQLite, self).select(query, fields, attributes)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/adapters/base.py", line 906, in select
    colnames, sql = self._select_wcols(query, fields, **attributes)
                    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/adapters/base.py", line 792, in _select_wcols
    query = self.expand(query, query_env=query_env)
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/adapters/base.py", line 497, in _expand
    rv = op(first, second, **optional_args)
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/dialects/base.py", line 291, in belongs
    sub = second._compile(query_env.get("current_scope", []))[1][:-1]
          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/objects.py", line 1454, in _compile
    colnames, sql = adapter._select_wcols(
                    ~~~~~~~~~~~~~~~~~~~~~^
        self._query, self._qfields, **attributes
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/alan-etkin/iapydal_venv/lib/python3.14/site-packages/pydal/adapters/base.py", line 694, in _select_wcols
    raise SyntaxError("Set: no tables selected")
SyntaxError: Set: no tables selected

Reply all
Reply to author
Forward
0 new messages