New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

Tachyon

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Tachyon

TachyonDB schemaless, asynchronous data modeling library. *Disclaimer: not production tested, or spec complete!*

0.0.1
latest
npm
Version published
Maintainers
1
Created
Source

tachyon

TachyonDB schemaless, asynchronous data modeling library. Disclaimer: not production tested, or spec complete!

introduction

TachyonDB provides a schemaless interface for building and manipulating object models on top of relational databases.

interface

defining a model

const UserEntity = new EntityType('User', {
  canonicalEmail: { type: Types.string, index: true },
  firstName: { type: Types.string },
  lastName: { type: Types.string },
  genderPreference: { type: Types.number },
  createdAt: { type: Types.dateTime, index: true}
})

inserting a model

const newUser = UserEntity
  user.setProperty(
    'canonicalEmail',
    'jasonbyttow@gmail.com'
  )
  insertEntity((newUser)
  .then((user) => {
    console.log(`user ${user.getProperty('canonicalEmail')} added`)
  })

retrieving a model

getEntityByKeyValue(
  UserEntity.type,
  UserEntity.schema.canonicalEmail.type,
  'canonicalEmail',
  'jasonbyttow@gmail.com'
)
.then((user) => {
 if (user) {
   console.log(`user ${user.getProperty('canonicalEmail')} retrieved`)
 }
})

FAQs

Package last updated on 16 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts