2.0.6 • Published 9 months ago

joi-of-cql v2.0.6

Weekly downloads
7
License
MIT
Repository
github
Last release
9 months ago

joi-of-cql

Create cql type definitions from joi schema validations

Usage

var joc = require('joi-of-cql');

apollo.define('car', {
  schema: joc.object({
    car_id: joc.cql.uuid(),
    manufacturer_id: joc.cql.uuid(),
    drivers: joc.set(joc.cql.uuid())
  }).partitionKey('car_id')
    .clusteringKey('manufacturer_id')
CQL Data TypeValidation Type
asciicql.ascii()
bigintcql.bigint()
blobcql.blob()
booleancql.boolean()
countercql.counter()
decimalcql.decimal()
doublecql.double()
floatcql.float()
inetcql.inet()
textcql.text()
timestampcql.timestamp()
timeuuidcql.timeuuid()
uuidcql.uuid()
varcharcql.varchar()
varintcql.varint()
mapcql.map(cql.text(), cql.text()),
setcql.set(cql.text())

Extensions to Joi.Object

  • .partitionKey(key) - key can be an array or a single string identifying one or more of the properties in the schema as a partition key.
  • .partitionKey() - retrieve the previously defined partition key.
  • .clusteringKey(key) - key can be an array or a single string identifying one or more of the properties in the schema as a clustering key.
  • .clusteringKey() - retrieve the previously defined clustering key.
  • .lookupKeys(...keys) - either an array of lookup keys or lookup keys passed as arguments that are collected into an array.
  • .lookupKeys() - retrieve the previously defined lookup keys.
  • .aliases() - retrieve the previously defined renamed properties.
2.0.5

9 months ago

2.0.4

9 months ago

2.0.6

9 months ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago