-
Notifications
You must be signed in to change notification settings - Fork 2
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
only index column supported? #8
Comments
Could it be that there is an exception raised somewhere in the |
just give you example
@almarklein I can not find what cause this |
Sorry, but I cannot see what's going wrong from these code samples alone. Please try to confine your use-case into one or two code-samples that are self-contained, by which I mean:
When you do that, my experience is that either of these happen:
|
all is about unique key
|
So any field names provided to Ok, here's an example that you can run. Perhaps you can provide a modified version that shows your problem? import itemdb
# Create in-memory database
db = itemdb.ItemDB(":memory:")
db.ensure_table("mytable", "!id", "age")
# Put some items in
with db:
db.put_one("mytable", id=1, age=20, name="Jill")
db.put_one("mytable", id=2, age=30, name="John")
db.put_one("mytable", id=3, age=40, name="Jane")
db.put_one("mytable", id=4, age=50, name="Jack")
# Now we can get items
print(db.count("mytable", "age > ?", 15)) # 4
print(db.count("mytable", "age > ?", 35)) # 2
print(db.select_one("mytable", "id == ?", 1)) # {'id': 1, 'age': 20, 'name': 'Jill'}
print(db.select_one("mytable", "age == ?", 30)) # {'id': 2, 'age': 30, 'name': 'John'}
# But this raises an IndexError.
# If you add "name" to the ensure_table() call, this will work.
print(db.select_one("mytable", "name == ?", "John")) |
I will try to give you a real example to reproduce my problem |
same db and table with 6 records in it ,post_id is index post_link is not ,
print is all the result expected
option2
constanly say False.
am i mistaken?
what if i need to know by whether the same post_link is there
The text was updated successfully, but these errors were encountered: