MCPcopy Create free account
hub / github.com/instantdb/instant / main

Function main

examples/python-script/main.py:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def main() -> None:
19 todo_id = id()
20 db.transact(
21 db.tx.todos[todo_id].update(
22 {
23 "text": "Hello from Python!",
24 "done": False,
25 "createdAt": int(time.time() * 1000),
26 }
27 )
28 )
29
30 result = db.query({"todos": {}})
31 print(f"Found {len(result['todos'])} todo(s):")
32 for todo in result["todos"]:
33 status = "x" if todo["done"] else " "
34 print(f" [{status}] {todo['text']}")
35
36
37if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 4

idFunction · 0.90
transactMethod · 0.45
updateMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected