Libraries that ease q development
Q Toolkit (QTK) is a set of libraries that ease development by q, a language for kdb+. It provides the following tools:
- simple package/module management
- uniform APIs to interact with tables regardless of whether they are in-memory or on-disk
- database management utilities
- file system utilities
- structured error raising
- Download the zipped file from the latest release.
- Unzip it.
unzip qtk-0.1.zip cd qtk-0.1
- Export
QTK
environment variable and point it to the absolute path.export QTK=$(readlink -f .)
- Start a
q
session and loadinit.q
.Alternatively load the script within a q session# load the script via command line q init.q
system "l ",getenv[`QTK],"/init.q";
Browse the docs and search for what you may need. The following is a CRUD example.
.qtk.import.loadModule["tbl";`qtk]; // Import tbl module from qtk package
tabRef:(`:/tmp/qtk/db; `date; `Table); // A partitioned table ID that specifies database directory, partition field, and table name
.qtk.tbl.create[tabRef; ([] date:2022.01.01 2022.01.02; c1:1 2)] // Create the partitioned table with given data
.qtk.tbl.load `:/tmp/qtk/db;
.qtk.tbl.update[`Table; (); 0b; (enlist`c1)!(enlist (*;`c1;2))];
.qtk.tbl.select[`Table; (); 0b; 0#`];
.qtk.tbl.drop `Table;
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Copyright © 2023 Darren Sun.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator