MikhailNazarov / ydb-rs-sqlx

Sqlx integration for YDB rust SDK
https://ydb.tech/
Apache License 2.0
2 stars 1 forks source link

Make schema queries available with pool #7

Closed MikhailNazarov closed 1 month ago

MikhailNazarov commented 1 month ago

It's required to use schema executor for schema queries:

let conn = pool.acquire().await?;
    sqlx::query("CREATE TABLE test2 (id Uint64 NOT NULL, name Utf8, age UInt8, description Utf8, PRIMARY KEY (id))")
        .execute(conn.schema())
        .await?;

Now it's available from connection object. We need provide more convenient way get schema executor from db connection pool

MikhailNazarov commented 1 month ago

We can now use extension method schema for YdbPool

sqlx::query("CREATE TABLE test2 (id Uint64 NOT NULL, name Utf8, age UInt8, description Utf8, PRIMARY KEY (id))")
        .execute(pool.schema())
        .await?;