npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

enchantedsql

v0.0.1

Published

Improved official wrapper of Qui Database

Downloads

6

Readme

EnchantedSQL

EnchantedSQL es una API de base de datos basada en el lenguaje "SQL" y que combina la tecnología de secuenciación de Qui Database.

¿Por qué usar EnchantedSQL?

Enchanted mejora la experiencia de gestión de datos con estas funciones:

  • Nueva extensión .qui para las bases de datos (basada en la tecnología MongoDB BSON)
  • Sintaxis similar a SQL, por lo que es más fácil para las personas que normalmente usan SQLite o MySQL
  • Soporte de consultas y evaluaciones

Instalación

Puedes instalar el NPM ejecutando: npm install enchantedsql --save Es recomendado utilizar la versión de NodeJS 14.15.1 LTS para este NPM.

Documentación y Ejemplos

Recuerda: Puedes encontrar diversos ejemplos y la documentación completa de Enchanted SQL en nuestra página web.

createConnection

createConnection es para establecer una conexión para hacer funcionar la base de datos. Además, esto creará una configuración .entconfig.yaml con algunos parámetros para aplicar.

const enchanted = require('enchantedsql')

const db = enchanted.createConnection({
    host: '127.0.0.1', 
    port: 25560, // este es el puerto por defecto de EnchantedSQL. Puedes cambiarlo si quieres.
    user: 'root', // root siempre tendrá todos los permisos de la base de datos.
    pass: '' // Contraseña de la base de datos
})
connect

connect() solo funcionará si utilizaste createConnection antes.

db.connect()
prepare

prepare está destinado a preparar datos para luego asignar cambios a la función de consulta.

db.prepare({ db: 'test', key: 'id1', value: '1234' })
// test es la base de datos.
// id1 es la key
// 1234 es el valor
query

query está destinado a ejecutar el lenguaje SQL para crear archivos db. Primero debe usar la función prepare para usar query.

// insert
db.query('INSERT ON DATABASE test PARAMETERS (id1, jake)')
// select
db.query('SELECT VALUE FROM DATABASE test WHERE KEY = id1')
// evaluate result (for checking if an object exists)
db.query('EVALUATE RESULT FROM DATABASE test WHERE KEY = id1')
// delete a database
db.query('DELETE DATABASE test')
viewSettings

viewSettings te permite ver toda la configuración actual.

db.viewSettings()
// devuelve el archivo .entconfig.yaml
close

cierra la conexión a EnchantedSQL

Como funciona:

Linea de codigo JavaScript:

db.query('INSERT ON DATABASE foods PARAMETERS (14, popcorn)')

Lo que se almacena en la base de datos:

{"14": "Popcorn"}