c-questdb-client icon indicating copy to clipboard operation
c-questdb-client copied to clipboard

Support for LONG, BINARY types with rust client

Open Callum-A opened this issue 1 year ago • 3 comments

Is there an accepted approach in Rust to write LONG / LONG256 / BINARY types using the Buffer's provided?

Callum-A avatar Jun 03 '24 12:06 Callum-A

The Rust client is an ILP client. ILP is a text protocol that supports a subset of all the QuestDB types: Oher types are targeted via datatypes conversions when the server receives the data.

The general approach here is to issue a SQL CREATE TABLE statement with the desired schema ahead of ingesting into it via the ILP clients.

In other words, if you send an integer, QuestDB will generally "guess" that it's an INT, but you can force it to be a SHORT or a LONG providing a schema in advance.

If you've created the table already, use an ALTER TABLE statement.

  • LONG: This approach should get you sorted for the LONG datatype.
  • BINARY: If you need to insert BINARY data at the moment your only option is to use a PgWire client at the moment.
  • LONG256: There is ILP support (at the protocol level) for LONG256, but it's not implemented yet: https://questdb.io/docs/reference/api/ilp/columnset-types/#long256 - Is this something you'd need? What's your use case around it?

amunra avatar Jun 04 '24 10:06 amunra

It feels like my limitations are mainly with the client then. For example I have a couple u128 types in Rust I'd love to store as LONGs on the table, the DDL part is fine and creating the table works. However due to the lack of a .column_u128 .column_u64 I am unable to store that data via Rust code.

Callum-A avatar Jun 05 '24 13:06 Callum-A

Any update on this?

Callum-A avatar Jun 19 '24 19:06 Callum-A