Skip to content

Commit 883b2ea

Browse files
committed
version: 0.1.1
Additionally, the README was updated
1 parent 0a10655 commit 883b2ea

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,31 @@ pip install skytable-py
1616
Use in your code:
1717
```python
1818
import asyncio
19-
from skytable_py import Config
19+
from skytable_py import Config, Query
2020

21-
c = Config(username="root", password="password")
2221

22+
c = Config("root", "mypassword123456789")
2323

24-
async def main():
25-
db = await c.connect()
26-
# ... use the db
2724

25+
async def main():
26+
db = None
27+
try:
28+
db = await c.connect()
29+
# init space
30+
assert (await db.run_simple_query(Query("create space apps"))).is_empty()
31+
# init model
32+
assert (await db.run_simple_query(Query("create model apps.auth(username: string, password: string)"))).is_empty()
33+
# insert our test row
34+
assert (await db.run_simple_query(Query("insert into apps.auth(?, ?)", "sayan", "mypassword"))).is_empty()
35+
# fetch data
36+
username, password = (await db.run_simple_query(Query("select * from apps.auth where username = ?", "sayan"))).row().columns
37+
# output
38+
print(f"username={username.string()}, password={password.string()}")
39+
except Exception as e:
40+
print(f"failed with error {e}")
41+
finally:
42+
if db:
43+
await db.close()
2844

2945
if __name__ == "__main__":
3046
asyncio.run(main())

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "skytable-py"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
authors = [{ name = "Sayan Nandan", email = "[email protected]" }]
99
description = "Official Skytable client library for Python"
1010
readme = "README.md"

0 commit comments

Comments
 (0)