Commit graph

2 commits

Author SHA1 Message Date
Parker Gurney
fe5260e47e Make tables in attached/temp schemas first-class (issue #432)
Table/View gain an explicit alias attribute for their attached or temp
schema. db["alias.table"] resolves it when alias names a real attached
database or the temp schema (schema_names), leaving plain and
literally-dotted main-schema names unaffected. exists(), columns,
schema, indexes, foreign_keys, triggers, and the read/write path
(rows_where, get, insert/insert_all, upsert, update, delete,
delete_where, add_column, drop, analyze) are all schema-qualified
correctly instead of silently checking/writing the main schema.

Methods that would need deeper cross-schema rework (create, transform,
create_index, enable_fts and friends, add_foreign_key, extract,
duplicate, spatial columns) raise a clear NotImplementedError for
aliased tables instead of silently operating on a same-named
main-schema table.
2026-08-05 14:38:20 -07:00
Simon Willison
999f099cbe db.attach(alias, filepath) method, closes #113
Will also be useful for #236
2021-02-18 20:56:32 -08:00