0.0.66 • Published 4 years ago

clay-base-sdk v0.0.66

Weekly downloads
253
License
ISC
Repository
-
Last release
4 years ago

Clay Base SDK

What is Clay Base? Clay Base is the serverless stateless database. Ideal for Lambda functions. Learn more

This SDK connects to Clay Base seemlessly using your Private key.

Install

Using npm:

npm install clay-base-sdk

Usage

Inserting rows:

const Base = require('clay-base-sdk')
Base.initialize('PRIVATE_KEY') // private key

Base.users.insert({
    username: 'playerunkown',
    game: 'battlegrounds'
}).then(_ => {
    // row inserted into the base

    // let's query all the players
    return users.findAll()
}).then((rows) => {
    // rows = [ { username: 'playerunkown', game: 'battlegrounds }]
})

Raw queries

Clay Base runs on Postgres, which allows you to run raw queries in a totally secure environment.

const Base = require('clay-base-sdk')
Base.initialize('PRIVATE_KEY') // private key

Base.query(`SELECT * FROM players WHERE username="unkownplayer" LIMIT 1`).then((rows) => {
    // rows = [ { username: 'playerunkown', game: 'battlegrounds }]
})

Querying

We offer a Javascript friendly interface to query rows in a basic way:

const Base = require('clay-base-sdk')
Base.initialize('PRIVATE_KEY') // private key

users.find({
    where: {
        username: 'playerunkown'
    },
    order: 'createdAt DESC',
    limit: 1
}).then((rows) => {
    // rows = [ { username: 'playerunkown', game: 'battlegrounds }]
})

Bugs

Please report bug and issues in the issues tab on Github.

Author

This repository is maintained and published by Clay Labs Inc.

0.0.66

4 years ago

0.0.64

6 years ago

0.0.63

6 years ago

0.0.62

6 years ago

0.0.61

6 years ago

0.0.60

6 years ago

0.0.59

6 years ago

0.0.58

6 years ago

0.0.57

6 years ago

0.0.56

6 years ago

0.0.55

6 years ago

0.0.54

6 years ago

0.0.53

6 years ago

0.0.52

6 years ago

0.0.51

6 years ago

0.0.50

6 years ago

0.0.49

6 years ago

0.0.48

6 years ago

0.0.47

6 years ago

0.0.46

6 years ago

0.0.45

6 years ago

0.0.44

6 years ago

0.0.43

6 years ago

0.0.42

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

6 years ago

0.0.31

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago