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

pyxisdb

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyxisdb

A real-time database package for communicating with Pyxiscloud server using WebSockets

  • 0.0.1-beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
0
Weekly downloads
 
Created
Source

PyxisDB

PyxisDB is a real-time database package for communicating with Pyxiscloud server. It provides a simple and efficient way to interact with your database using WebSocket connections.

Installation

To install PyxisDB, use npm:

npm install pyxisdb

Usage

Here's a basic example of how to use PyxisDB:

const pyx = require('pyxisdb');

// Connect to the Pyxiscloud server
pyx.connect('wss://your-pyxiscloud-server.com')
  .then(() => {
    console.log('Connected to PyxisCloud');
    
    // Define a schema
    const userSchema = pyx.schema({
      name: { type: 'string', required: true },
      age: { type: 'number' },
      email: { type: 'string', required: true }
    }, 'users');

    // Create a model
    const User = pyx.model('users', userSchema);

    // Insert a document
    User.insert({
      name: 'John Doe',
      age: 30,
      email: 'john@example.com'
    })
    .then(result => console.log('Inserted:', result))
    .catch(error => console.error('Insert error:', error));

    // Find documents
    User.find({ age: { $gte: 18 } })
      .then(users => console.log('Adult users:', users))
      .catch(error => console.error('Find error:', error));
  })
  .catch(error => console.error('Connection error:', error));

Features

  • Real-time database operations
  • Schema validation
  • Automatic reconnection
  • Support for insert, find, update, and delete operations
  • Count and exists queries

API Reference

pyx.connect(url)

Connects to the Pyxiscloud server.

pyx.schema(schemaDefinition, collectionName)

Defines a schema for a collection.

pyx.model(collectionName, schema)

Creates a model based on a schema.

Model Methods

  • insert(document): Inserts a new document
  • find(query): Finds documents matching the query
  • update(query, updateFields): Updates documents matching the query
  • delete(query): Deletes documents matching the query
  • count(query): Counts documents matching the query
  • exists(field, value): Checks if a document with the given field-value pair exists

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 03 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc