MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / main

Function main

samples/sample_app.py:505–541  ·  view source on GitHub ↗

Run the full extenddb lifecycle demonstration.

()

Source from the content-addressed store, hash-verified

503# ---------------------------------------------------------------------------
504
505def main() -> int:
506 """Run the full extenddb lifecycle demonstration."""
507 print("extenddb Sample Application — Full Lifecycle Demo")
508 print(f"Endpoint: {ENDPOINT}")
509 print(f"Region: {REGION}")
510
511 client = make_client()
512
513 # Clean up any leftover tables from a previous run.
514 for name in [USERS_TABLE, ORDERS_TABLE, TOURNAMENT_TABLE]:
515 delete_table_safe(client, name)
516 # Brief pause for control plane to process deletions.
517 time.sleep(1)
518
519 try:
520 create_tables(client)
521 wait_for_tables(client)
522 load_data(client)
523 query_data(client)
524 update_data(client)
525 batch_operations(client)
526 transaction_operations(client)
527 delete_data(client)
528 drop_tables(client)
529
530 section("Done!")
531 print(" All 9 steps completed successfully.")
532 print(" Full lifecycle: create → load → query → update → batch → transact → delete → drop")
533 return 0
534
535 except Exception as e:
536 print(f"\n ✗ Error: {e}", file=sys.stderr)
537 # Best-effort cleanup on failure.
538 print("\n Cleaning up tables...")
539 for name in [USERS_TABLE, ORDERS_TABLE, TOURNAMENT_TABLE]:
540 delete_table_safe(client, name)
541 return 1
542if __name__ == "__main__":
543 sys.exit(main())

Callers 1

sample_app.pyFile · 0.70

Calls 12

delete_table_safeFunction · 0.85
create_tablesFunction · 0.85
wait_for_tablesFunction · 0.85
load_dataFunction · 0.85
query_dataFunction · 0.85
update_dataFunction · 0.85
batch_operationsFunction · 0.85
transaction_operationsFunction · 0.85
delete_dataFunction · 0.85
drop_tablesFunction · 0.85
sectionFunction · 0.85
make_clientFunction · 0.70

Tested by

no test coverage detected