-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
table.xindexes
using PRAGMA index_xinfo(table)
#261
Comments
This would be a breaking change - and the fact that it returns auxiliary columns isn't particularly useful for most cases - "Auxiliary columns are additional columns needed to locate the table entry that corresponds to each index entry". Instead, I'm going to add a new property |
table.indexes
should use 'PRAGMA index_xinfo(table)`table.xindexes
using 'PRAGMA index_xinfo(table)`
table.xindexes
using 'PRAGMA index_xinfo(table)`table.xindexes
using PRAGMA index_xinfo(table)
In prototyping this out I realize that I actually want to get back the name of each index, then for each of them the detailed list of index columns. Here's the test from my initial prototype: def test_xindexes(fresh_db):
fresh_db.executescript(
"""
create table Gosh (c1 text, c2 text, c3 text);
create index Gosh_c1 on Gosh(c1);
create index Gosh_c2c3 on Gosh(c2, c3 desc);
"""
)
assert fresh_db["Gosh"].xindexes == [
(
"Gosh_c2c3",
[
XIndex(seqno=0, cid=1, name="c2", desc=0, coll="BINARY", key=1),
XIndex(seqno=1, cid=2, name="c3", desc=1, coll="BINARY", key=1),
XIndex(seqno=2, cid=-1, name=None, desc=0, coll="BINARY", key=0),
],
),
(
"Gosh_c1",
[
XIndex(seqno=0, cid=0, name="c1", desc=0, coll="BINARY", key=1),
XIndex(seqno=1, cid=-1, name=None, desc=0, coll="BINARY", key=0),
],
),
] |
I'm going to return |
New design: def test_xindexes(fresh_db):
fresh_db.executescript(
"""
create table Gosh (c1 text, c2 text, c3 text);
create index Gosh_c1 on Gosh(c1);
create index Gosh_c2c3 on Gosh(c2, c3 desc);
"""
)
assert fresh_db["Gosh"].xindexes == [
XIndex(
name="Gosh_c2c3",
columns=[
XIndexColumn(seqno=0, cid=1, name="c2", desc=0, coll="BINARY", key=1),
XIndexColumn(seqno=1, cid=2, name="c3", desc=1, coll="BINARY", key=1),
XIndexColumn(seqno=2, cid=-1, name=None, desc=0, coll="BINARY", key=0),
],
),
XIndex(
name="Gosh_c1",
columns=[
XIndexColumn(seqno=0, cid=0, name="c1", desc=0, coll="BINARY", key=1),
XIndexColumn(seqno=1, cid=-1, name=None, desc=0, coll="BINARY", key=0),
],
),
] |
The text was updated successfully, but these errors were encountered: