82 Commits

Author SHA1 Message Date
Charles Leifer 007fd50bc7 Just some housekeeping 2026-03-25 08:20:06 -05:00
Charles Leifer eda231b047 Update changelog, fix failing crdb sql test. 2026-03-24 21:32:12 -05:00
Charles Leifer 071d0a0362 Cleanup cruft in sql and merge it into appropriate cases. 2026-03-24 21:13:44 -05:00
Charles Leifer 2d20c8acb4 Updates to tests, gone through model_sql and cleaned-up. 2026-03-24 09:55:48 -05:00
Charles Leifer b323fc5903 Gap coverage - needs review. 2026-03-22 22:02:18 -05:00
Charles Leifer d8c15c3c57 Some more high-level cleanup after AI reorg. 2026-03-22 16:17:10 -05:00
Charles Leifer 4073c2d490 New tests covering some existing gaps. 2026-03-22 10:44:23 -05:00
Charles Leifer c17dc048fb New tests for model_sql to cover some gaps. 2026-03-22 10:25:00 -05:00
Charles Leifer 6418faf6ce Reorganization within larger modules. 2026-03-22 10:12:54 -05:00
Charles Leifer b1196c8ac9 Comments for sections to serve as anchors for reorganization. 2026-03-22 09:40:24 -05:00
Charles Leifer 95e95fae8c Test reorg. 2026-03-21 21:26:37 -05:00
Charles Leifer 21ea54a2cc Add a few more SQL generation and field-type tests.
Also fix a locking issue that came up w/serverside when running tests
against psycopg3.
2026-03-17 20:33:28 -05:00
Charles Leifer 8ed29c0e47 Clean up window aliasing, add some test coverage that was missing. 2026-03-17 18:37:46 -05:00
Charles Leifer 0407f59b80 Fix alias-manager not clearing context - harmless but fixed. 2026-03-15 20:48:05 -05:00
Charles Leifer 84f3371b55 Add option to specify NULLS DISTINCT / NULLS NOT DISTINCT
Refs #3024
2026-01-23 16:47:57 -06:00
Charles Leifer 01b014911a Allow models in select_extend(), fixes #2563 2022-05-25 09:49:35 -05:00
Charles Leifer 838030e653 Add public property selected_columns to Select.
Fixes #2545
2022-03-07 08:38:23 -06:00
Matthew Moisen (mmoisen) fed3f7e560 Add left_outer_join function to ModelSelect. 2022-02-22 10:40:29 -08:00
Charles Leifer 9794176d6a Support specification of conflict target for ON CONFLICT/DO NOTHING.
Refs SO 67781043
2021-06-01 11:01:52 -05:00
Charles Leifer 12d05a0edd Insert NULL for missing nullable fields on bulk insert.
Fixes #2368 and replaces #2369
2021-03-05 08:36:27 -06:00
Charles Leifer d627004f64 Fix filter w/args & kwargs, #2293 2020-11-07 12:28:05 -06:00
Charles Leifer 3c8eba0e0d Workaround for passing model-classes as arguments.
Fixes #2131
2020-03-11 10:18:44 -05:00
Charles Leifer f1888a0434 Work through additional tests. 2019-12-03 18:33:07 -06:00
Charles Leifer c2dc7ca7ca Support aliases in RETURNING clause.
Fixes #2046. Changes the logic used for representing SQL nodes within
a RETURNING clause to use the more declarative SCOPE_SOURCE.
2019-10-20 21:44:29 +00:00
Charles Leifer ba57ccc7ab Add test for update+subqueries. 2019-07-30 15:12:43 -05:00
Charles Leifer fd2580678d Test insert w/modelalias. 2019-07-30 14:51:42 -05:00
Charles Leifer cb998a534d Add tests for paginate() method. 2019-07-30 14:33:59 -05:00
Charles Leifer bb45c6601f More permissive bulk-insert. 2019-07-29 22:25:06 -05:00
Charles Leifer cb179f055e When generating joins, only introspect actual field objects.
Fixes #1914.
2019-04-27 08:12:28 -05:00
Charles Leifer 29847f2588 Infer fields/columsn for bulk insert via insert_many().
When doing a bulk insert via insert_many(), if the row(s) being inserted
are lists/tuples and no fields argument is specified, default to all
fields except autoincrement id (if one exists).
2019-04-01 22:08:30 -05:00
Charles Leifer 729ebae16d Small refactor and bugfix in on conflict tests. 2019-02-17 15:40:25 -06:00
Charles Leifer 8067301614 Remove support for table_alias model meta option.
Resolves #1829
2019-01-15 16:09:44 -06:00
Charles Leifer 283289b3bb Use qualified names in RETURNING clauses. 2018-11-06 14:13:02 -06:00
Charles Leifer 2018e579ac Integrate support for UPDATE/FROM queries.
Replaces #1776
2018-11-06 11:06:12 -06:00
Charles Leifer 8e4808eb84 Use qualified names in WHERE clause for UPDATE and DELETE queries.
This patch retains half of the changes from #1775, and also applies the
logic to DELETE queries. The result is that the where clause of update
and delete queries will now use fully-qualified names to reference
columns.
2018-11-03 17:37:19 -05:00
Charles Leifer 88b8d83646 Revert "Correct format for PostgreSQL UPDATE statement with FROM clause."
This reverts commit 6e3e9f4a6f.
2018-11-03 17:20:34 -05:00
Roberto Abdelkader Martínez Pérez 6e3e9f4a6f Correct format for PostgreSQL UPDATE statement with FROM clause. 2018-11-03 12:15:37 +01:00
Charles Leifer c82cd991e5 Add tests for order_by() and order_by_extend(). 2018-10-12 09:01:34 -05:00
Nguyen Khac Nhat efa0eea13d fix bug group by extend 2018-10-12 14:32:11 +09:00
Charles Leifer 7c45c9e6bb Add support for performing CROSS JOIN with Models.
Fixes #1713
2018-09-08 18:07:51 -05:00
Charles Leifer fb2268a24c Allow fields/columns to be list of strings with bulk INSERT.
Refs #1712.
2018-09-07 21:36:09 -05:00
Charles Leifer d0f73d09d8 Better conversion of class name to snake-case table names.
Add test-case for new table-naming function.
2018-06-28 16:35:38 -05:00
Charles Leifer 75096bc192 Slight re-org to improve coverage of UPDATE...FROM tests. 2018-06-18 16:27:32 -05:00
Charles Leifer 62e614924f Treat limit and offset as parameters rather than literals 2018-05-11 15:01:23 -05:00
Charles Leifer ca4c1cdd22 Avoid unnecessary subquery when processing model dependencies.
Fixes regression of #515 and further improves SQL generation.
2018-05-03 11:15:37 -05:00
Charles Leifer 1691519419 Update failing test in model sql generation. 2018-04-30 08:59:30 -05:00
Charles Leifer 084d7d20aa More robust handling of INSERT+RETURNING. Refs #1522. 2018-02-27 22:01:58 -06:00
Charles Leifer fb44d34d13 Add additional assertion about bytes -> unicode. 2018-02-26 11:11:28 -06:00
Charles Leifer d7f03508cd Ensure model schema is included when using ModelAlias().
Fixes #1518.
2018-02-26 10:19:20 -06:00
Charles Leifer a49441124d Fix regression in #1438, calling select() twice with no params. 2018-01-31 06:23:11 -06:00