Skip to content

Commit

Permalink
update the demo file
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
  • Loading branch information
seapagan committed Jan 27, 2025
1 parent f931b31 commit 15fd5b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from __future__ import annotations

import logging
from typing import Optional
from typing import ClassVar, Optional

from sqliter import SqliterDB
from sqliter.exceptions import RecordInsertionError
Expand All @@ -26,6 +26,7 @@ class UserModel(BaseDBModel):
content: Optional[str]
admin: bool = False
list_of_str: list[str]
a_set: ClassVar[set[str]] = set()

class Meta:
"""Override the table name for the UserModel."""
Expand All @@ -51,6 +52,7 @@ def main() -> None:
content="This is information about John Doe.",
admin=True,
list_of_str=["a", "b", "c"],
a_set={"x", "y", "z"},
)
user2 = UserModel(
slug="jdoe2",
Expand All @@ -63,6 +65,7 @@ def main() -> None:
name="Yogie Bear",
content=None,
list_of_str=[],
a_set={"apple", "banana", "cherry"},
)
try:
db.insert(user1)
Expand Down

0 comments on commit 15fd5b4

Please sign in to comment.