Skip to content

Commit

Permalink
version: 0.1.1
Browse files Browse the repository at this point in the history
Additionally, the README was updated
  • Loading branch information
ohsayan committed May 1, 2024
1 parent 0a10655 commit 883b2ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,31 @@ pip install skytable-py
Use in your code:
```python
import asyncio
from skytable_py import Config
from skytable_py import Config, Query

c = Config(username="root", password="password")

c = Config("root", "mypassword123456789")

async def main():
db = await c.connect()
# ... use the db

async def main():
db = None
try:
db = await c.connect()
# init space
assert (await db.run_simple_query(Query("create space apps"))).is_empty()
# init model
assert (await db.run_simple_query(Query("create model apps.auth(username: string, password: string)"))).is_empty()
# insert our test row
assert (await db.run_simple_query(Query("insert into apps.auth(?, ?)", "sayan", "mypassword"))).is_empty()
# fetch data
username, password = (await db.run_simple_query(Query("select * from apps.auth where username = ?", "sayan"))).row().columns
# output
print(f"username={username.string()}, password={password.string()}")
except Exception as e:
print(f"failed with error {e}")
finally:
if db:
await db.close()

if __name__ == "__main__":
asyncio.run(main())
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "skytable-py"
version = "0.1.0"
version = "0.1.1"
authors = [{ name = "Sayan Nandan", email = "[email protected]" }]
description = "Official Skytable client library for Python"
readme = "README.md"
Expand Down

0 comments on commit 883b2ea

Please sign in to comment.