Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import ydb
- config = ydb.DriverConfig(
- endpoint="grpc://ydb-local:2136",
- database="/local",
- )
- credentials = ydb.StaticCredentials(
- driver_config=config,
- user="root",
- password="1234"
- )
- with ydb.Driver(driver_config=config, credentials=credentials) as driver:
- driver.wait(timeout=5)
- with ydb.SessionPool(driver) as pool:
- def callee(session):
- session.execute_scheme(
- """
- CREATE table `seasons` (
- `series_id` Uint64,
- `season_id` Uint64,
- `title` Utf8,
- `first_aired` Uint64,
- `last_aired` Uint64,
- PRIMARY KEY (`series_id`, `season_id`)
- )
- """
- )
- pool.retry_operation_sync(callee)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement