d  General www.jsoftware.com
J database - J language
columnar analytics

install run args demos names types drop/delete

install

Install Jd (addon data/jd) with JAL/Package Manager. Jd requires J64 (803 or later) on Windows, Linux, or Mac.


run

There is a slight preference for JHS as the front end. Running Jd tutorials in jconsole is awkward. Eventually your Jd systems are likely deployed in servers (perhaps in a cloud) and JHS makes secure remote management and development a natural continuation of using Jd on your own local machine. If not already familiar with the JHS front end, time spent getting familiar is time well spent.

load'data/jd' ... welcome message ...

The welcome message tells you if you require a license key and how to get one.

Be sure to browse and bookmark the documentation url given in the welcome.

For a new install and after updates it is a good idea to run jdtests'' to validate the installation and create demo databases.

The welcome message suggests how to get started. In particular how to list and run tutorials and examples.


args

jd'...' NB. perform Jd user op

Arg parses to a list of boxes. A string is treated as list of blank delimited boxes. The first box in a list of boxes is treated as a list of blank delimited values. jd'reference a b c d' === jd'reference';'a';'b';'c';'d' jd'insert f a';23 === jd'insert';'f';'a';23
Col definitions have blanks and are delimited by , or LF and have more complicated rules. The following are equivalent: jd'createtable f a int,b byte 4' jd'createtable f a int',LF,'byte 4' jd'createtable';'f';'a int';'b byte 4' jd'createtable f a';'a int';'b byte 4'
Options follow the command, have a fixed number (0 or more) parameters, and should be in the order documented. jd'reads /lr /e f' === jd'reads';'/lr';'/e';'f' jd'createtable /a 1 2 3 f a int' === jd'createtable';'/a';'1';'2';'3';'f';'a int'

names

column, table, and dan names have similar validation

RESERVEDCHARS_jd_ are not allowed in names
RESERVEDWORDS_jd_ are not allowed
jd... prefix is not allowed in table or column name
~... prefix is not allowed

+- are allowed in names, but should be avoided in table names because of conflicts with parse of the read from clause

^ is used by the system in table names for ptable and should be avoided

types

standard types: boolean, int, float, byte
all standard types can have trailing shape jd'createtable f a int 2,b byte 4' NB. n,2 int and n,4 byte
edate (epochdt) types:
iso 8601 format - stored as int - converted on read and write
epochdt int is nanoseconds before/after 2000-01-01
tutorial epochdt

edate - 2014-01-02
edatetime - 2014-01-02T03:04:05
edatetimem - 2014-01-02T03:04:05,123
edatetimen - 2014-01-02T03:04:05,123456789

date types:
date - int with digits yyyymmdd
datetime - int with digits yyyymmddhmmss
csv loader supports yyyy/mm/dd vs dd/mm/yyyy

varbyte:
less important in Jd than in most other systems
byte 200 that held the data is probably better

drop/delete

Database structure maps directly to folder structure. A database is a folder, a table is a folder in a database, and a column is a folder in a table.

A db/table/col drop can't be undone. It would be unfortunate to inadvertantly drop something that was hard to recover.

Restrictions while building a database can be a nuisance, but when things are stable it can be nice to disallow drops. This can be done with jdaccess but that is perhaps more mechanism than warranted.

jddropstop provides an easy way to prevent bad drops.

A db/table/col drop uses utility jddeletefolder. This utility is also used in other admin activities. For example, deleting folders of csv files that have been processed.

A jddeletefolder can't be undone. It would be unfortunate to inadvertantly delete something that was hard to recover.

jddeletefolder allows delete only if certain criteria are met and this can prevent an unintended delete.