KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ C API: Custom protocol like s3, gcp, ms

  • C API: Custom protocol like s3, gcp, ms

    Posted by morten on September 10, 2024 at 2:39 pm

    I noticed Kdb Insights (Object Storage) added some new protocols (https://code.kx.com/insights/1.10/core/objstor/main.html):

    aws ‘:s3://

    gcp ‘:gs://

    azure ‘:ms://

    That allows for custom behavior like

    q)key’:s3://

    ‘s#’kxinsights-marketplace-data

    I assume they’re being handed by libobjstor.so.

    How do we define such custom protocols?

    Thanks

    morten replied 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • choppergrip

    Member
    September 19, 2024 at 11:05 am

    Hey, samsogade, could you please add some details about what you are trying to achieve and what you mean when asking “How do we define…?” With more information, someone will be able to help

    • morten

      Member
      September 19, 2024 at 11:36 am

      Continuing with my example above. Let’s say I want to list the files in my current directory:

      q)key’:.

      KDB Insights introduces object storage that allows us to e.g. list files in an S3 bucket:

      q)key”$”:s3://kxinsights-marketplace-data/”

      ”’s#’_inventory’db’par.txt’sym’symlinks

      The functionality to interact with S3 is not part of vanilla Q. It’s provided by KDB Insights – in particular the shared object libobjstor.so shipped with KDB Insights.

      My question is how do we create such custom protocols using the C API? As a contrived example, perhaps I wanted to list all open positions in my IBKR trading account:

      q)key’$”:ibkr://account1/”

      Of course, I could create a regular function to do this, but let’s assume I really, really like this new syntax.

Log in to reply.