1.0.4 • Published 5 years ago

preql-core v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

PreQL

What is PreQL?

A Pre-SQL language for schema that can transpile to any SQL dialect. It uses a declarative Kubernetes-like YAML schema and generates the necessary commands or statements in the correct order to generate schema and other database objects in the database dialect of your choice. It also enables you to label your schema and interact with it programmatically, which is harder to do with traditional DBMS-specific schema.

Build

  1. Clone the repository.
  2. Install the necessary components by running npm install in the root directory.
  3. Build by running npm run build in the root directory.

Usage

This library is not useful alone. It is meant to be included in other programs that transpile PreQL into DBMS-specific DDL. Generally speaking, such a program will want to do the following:

  1. Call validateObject for each object. This just validates the object against schema.
  2. Call indexObjects on the array of validated objects. This produces a "database" that the next function will use.
  3. Call validateNamespace for each namespace produced by indexObjects. This performs more semantic validation, such as checking that foreign-key constraints are satisfied across objects, and ensuring that Attributes belong to a Struct that actually exists.

There are several functions provided by this library in source/Commands that are also exposed as Serverless functions that provide Core PreQL functionality.

Most of the documentation of this library is in the form of JSDoc comments and the TypeScript types.

For documentation of the individual API Object kinds, drill into source/APIObjectKinds, where you will find JSON schema, TypeScript interfaces, and JSDoc comments. It may be quicker to view the test data at test/data/kubey.yaml. The many Jest tests in test/jest may also be instructive.

Possible Future Features

  • PreQL Log (In-database log of errors, warnings, etc.)
  • ReplicationSet kind
  • VirtualAttribute kind
  • Shard kind
  • Sequence kind
  • Event kind
  • HASH setter, or something else for hashing. (This would be really useful for secure password storage.)
  • CONCAT setter (Check if string begins or ends with something, and CONCAT if not present.)
  • Add information about error codes in getPreqlInfo. I don't know how to do this.
  • Add Promise resolution and rejection value documentation when this issue is closed.
  • Handle support or non-support for Unicode Characters
  • Errors indicating when you are passing in the wrong datatype for non-Typescript use.
  • Write a command for testing data types.
  • JSONSchema titles and descriptions
  • Document target requirements.
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-w

5 years ago

1.0.0-v

5 years ago

1.0.0-u

5 years ago

1.0.0-t

5 years ago

1.0.0-s

5 years ago

1.0.0-r

5 years ago

1.0.0-q

5 years ago

1.0.0-p

5 years ago

1.0.0-o

5 years ago

1.0.0-n

5 years ago

1.0.0-m

5 years ago

1.0.0-l

5 years ago

1.0.0-k

5 years ago

1.0.0-i

5 years ago

1.0.0-h

5 years ago

1.0.0-g

5 years ago

1.0.0-f

5 years ago

1.0.0-epsilon

5 years ago

1.0.0-delta-rc1

5 years ago

1.0.0-delta

5 years ago

1.0.0-charlie

5 years ago

1.0.0-beta-rc10

5 years ago

1.0.0-beta-rc9

5 years ago

1.0.0-beta-rc8

5 years ago

1.0.0-beta-rc7

5 years ago

1.0.0-beta-rc6

5 years ago

1.0.0-beta-rc5

5 years ago

1.0.0-beta-rc4

5 years ago

1.0.0-beta-rc3

5 years ago

1.0.0-beta-rc2

5 years ago

1.0.0-beta-rc1

5 years ago

1.0.0-beta

5 years ago