mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-01 15:04:11 +02:00
insert now replaces square braces in column name with underscore, closes #341
This commit is contained in:
parent
fb9d61754a
commit
ffb54427d3
2 changed files with 14 additions and 8 deletions
|
|
@ -144,6 +144,7 @@ def test_create_table_with_not_null(fresh_db):
|
|||
[{"name": "memoryview", "type": "BLOB"}],
|
||||
),
|
||||
({"uuid": uuid.uuid4()}, [{"name": "uuid", "type": "TEXT"}]),
|
||||
({"foo[bar]": 1}, [{"name": "foo_bar_", "type": "INTEGER"}]),
|
||||
),
|
||||
)
|
||||
def test_create_table_from_example(fresh_db, example, expected_columns):
|
||||
|
|
@ -525,13 +526,6 @@ def test_insert_row_alter_table(
|
|||
]
|
||||
|
||||
|
||||
def test_insert_row_alter_table_invalid_column_characters(fresh_db):
|
||||
table = fresh_db["table"]
|
||||
table.insert({"foo": "bar"}).last_pk
|
||||
with pytest.raises(AssertionError):
|
||||
table.insert({"foo": "baz", "new_col[abc]": 1.2}, alter=True)
|
||||
|
||||
|
||||
def test_add_missing_columns_case_insensitive(fresh_db):
|
||||
table = fresh_db["foo"]
|
||||
table.insert({"id": 1, "name": "Cleo"}, pk="id")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue