sqlite-zstd
sqlite-zstd copied to clipboard
Cannot create compression on 2 tables with the same column name
It cannot create compression on 2 tables with the same column name. Run the code below and it duplicates the index name.
import sqlite3
conn = sqlite3.connect(r":memory:")
conn.enable_load_extension(True)
conn.load_extension(r"sqlite_zstd.dll")
conn.enable_load_extension(False)
conn.execute('''
CREATE TABLE table1 (
id INTEGER NOT NULL,
name VARCHAR,
data TEXT_JSON,
PRIMARY KEY (id)
);
''')
conn.execute('''
CREATE TABLE table2 (
id INTEGER NOT NULL,
name VARCHAR,
data TEXT_JSON,
PRIMARY KEY (id)
);
''')
conn.execute('''
SELECT
zstd_enable_transparent('{"table": "table1", "column": "data", "compression_level": 19, "dict_chooser": "''a''"}'),
zstd_enable_transparent('{"table": "table2", "column": "data", "compression_level": 19, "dict_chooser": "''a''"}')
''')
with the error: OperationalError: Could not create index on dictid
Caused by: 0: index _data_dict_idx already exists 1: Error code 1: SQL error or missing database
I hit the same error here