#test-containers #migration #query #database-client #yandex #functional #macro

ydb-steroids

Added extra functional to yandex database rust client. Such as migrations, macro for query, testcontainer support.

3 releases

0.1.2 Jul 13, 2022
0.1.1 Jul 13, 2022
0.1.0 Jul 12, 2022

#16 in #yandex

Apache-2.0

24KB
605 lines

Steroids for ydb client

Migration

let mut migrator = Migrator::new_from_dir(&include_dir!("$CARGO_MANIFEST_DIR/test-migration"));
migrator.migrate(&mut client).await.unwrap();

Query macros

query!("insert into a (id) values($id)", id=>id)

Select macros

let result: Vec<i32> = select!(client.table_client(), query!("select id from a"), id=>i32)
.await
.unwrap();

Update macros

update!(
client.table_client(),
    query!("insert into a (id) values($id)", id=>id)
)

Test container

Enable feature test_container

let (_node, client) = get_or_create_ydb_instance("should_create_docker_and_connect").await;

Dependencies

~25–41MB
~756K SLoC