[tx] Test that datom flags are written to SQL store correctly #119
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#119
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is follow-up to #267 and similar to #268. What we want is tests to ensure the
datoms
table gets the correctindex_*
flags set, based on the attribute flags. Thedatoms
schema is around42580539b8/db/src/db.rs (L56)
.To test this, use the existing transact code to transact assertions using some of the bootstrap attributes. Then use raw SQL to query the
datoms
table, following the examples in42580539b8/db/src/debug.rs
. (You might add a helper there to produce EDN for the "full" or "raw" datoms, making this a little easier to test, and possibly helping later on when we want to compare other parts of the raw tables.)The interesting cases are:
:db/index true
=> datom hasindex_avet = 1
:db/valueType :db.type/ref
=> datom hasindex_vaet = 1
:db/fulltext true
=> datom hasindex_fulltext = 1
Note: this can't be tested yet, since fulltext datoms aren't yet supported!:db/unique :db.unique/value
=> datom hasunique_value = 1
Check the positive and negative cases for each of those, and we're good! This is a pretty good first bug, I think, since there's lots of code similar to this in the tree already.