Skip to content

Allow QueryString in Table.raw, and nesting queries in QueryString - #1456

Open
officialasishkumar wants to merge 1 commit into
piccolo-orm:masterfrom
officialasishkumar:raw-querystring-support
Open

officialasishkumar wants to merge 1 commit into
piccolo-orm:masterfrom
officialasishkumar:raw-querystring-support

Conversation

@officialasishkumar

Copy link
Copy Markdown

Part of #406.

  • Table.raw now accepts a QueryString as well as a string (extra args are rejected in that case).
  • QueryString args can now be Query objects (e.g. Band.select(...)); the underlying querystring is nested. Multi-statement queries raise a ValueError.
  • Docs added to the raw query page, plus tests in tests/table/test_raw.py (run against SQLite locally).

…yString

Table.raw previously only accepted a string, so composing a query from
QueryString objects (which keep values parameterised) required reaching
into internals. It now also accepts a QueryString directly.

QueryString arguments can now also be Query objects (e.g. a select), in
which case the query's underlying QueryString is nested. Queries made up
of more than one statement are rejected with a ValueError.

Documented under the raw query docs. Refs piccolo-orm#406.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant