crate / crate/sqlalchemy-cratedb
feat: Support `column_policy` table option for CrateDB OBJECT type
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 3
Description
## Overview
During the review of PR #27 (adding `test_ddl_with_json_columns`), the question was raised whether the dialect should also support and test CrateDB's `column_policy` table option (e.g. `STRICT`, `DYNAMIC`, `IGNORED`) in DDL generation.
## Background
`column_policy` is a CrateDB table-level option that controls how columns are handled when inserting data that does not match the defined schema. It is not currently implemented in the dialect.
Currently implemented CrateDB-specific dialect options are:
- `crate_number_of_shards`
- `crate_clustered_by`
- `crate_number_of_replicas`
- `crate_partitioned_by`
- `crate_index`
- `crate_columnstore`
The `ObjectType` implementation does not currently handle any DDL-specific extras beyond what is defined in [`src/sqlalchemy_cratedb/type/object.py` (lines 64–79)](https://github.com/crate/sqlalchemy-cratedb/blob/889c7670960d28124746ee20a7eacbb2e538af45/src/sqlalchemy_cratedb/type/object.py#L64-L79).
## Tasks
- [ ] Investigate whether `column_policy` should be added as a supported table option in the CrateDB dialect
- [ ] If implemented, add corresponding DDL compiler tests (e.g. `column_policy = 'strict'`, `column_policy = 'dynamic'`, `column_policy = 'ignored'`)
## References
- PR: #27
- Discussion comment: https://github.com/crate/sqlalchemy-cratedb/pull/27#discussion_r3355672545
Contributor guide
Assessment
This issue has not been assessed yet.