You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Query Service interface is full of internal packages, which are not accessible from outside. Most importantly options package content. I guess it is intentional to make users use builders for them. But that makes it really hard to use them in client's code.
For example we have this case:
We have a configuration to define DB path (directory) where all tables (and other objects) live. And from the code point of view this is just part of a YDB client's configuration: the code that uses for example table.Client simply makes query as if tables were in the DB root.
To achieve this we have a table.Client wrapper (it implements ydb sdk table.Client) which adds PRAGMA TablePathPrefix to every query. This is very handy and (most importantly) allows other code to work both with pure sdk table.Client and our wrapper. For query.Service this is obviously impossible, because it is full of internal types.
Even if you don't want to expose your internal types, you still can make type aliases for them inside query package. Clients still won't be able to properly build their own implementation, but they can at least reference them.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Query Service interface is full of internal packages, which are not accessible from outside. Most importantly
options
package content. I guess it is intentional to make users use builders for them. But that makes it really hard to use them in client's code.For example we have this case:
We have a configuration to define DB path (directory) where all tables (and other objects) live. And from the code point of view this is just part of a YDB client's configuration: the code that uses for example
table.Client
simply makes query as if tables were in the DB root.To achieve this we have a
table.Client
wrapper (it implements ydb sdktable.Client
) which addsPRAGMA TablePathPrefix
to every query. This is very handy and (most importantly) allows other code to work both with pure sdktable.Client
and our wrapper. Forquery.Service
this is obviously impossible, because it is full of internal types.Even if you don't want to expose your internal types, you still can make type aliases for them inside query package. Clients still won't be able to properly build their own implementation, but they can at least reference them.
Beta Was this translation helpful? Give feedback.
All reactions