Run the full extenddb lifecycle demonstration.
()
| 503 | # --------------------------------------------------------------------------- |
| 504 | |
| 505 | def 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 |
| 542 | if __name__ == "__main__": |
| 543 | sys.exit(main()) |
no test coverage detected