🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@orjdev/mysqm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@orjdev/mysqm

Using NPM

unpublished
latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Installation

Using NPM

  npm i @orjdev/mysqm

initialize

import mySQM from "@orjdev/mysqm";

let client = new mySQM.Client({
  port: 3306,
  user: "",
  password: "1234567",
  host: "localhost",
  database: "",
});

You Can Use Custom Types Too

type IExpectedResults = { id: number; username: string };
let userModel = client.useModel("users");

Event Listener

type IEvents =
  | "connected"
  | "disconnected"
  | "result"
  | "error"
  | "end"
  | "fields"
  | "packet";
client.on("connected", () => console.log("connected"));

Get One

let query = {
  where: {
    id: {
      eq: 1,
    },
  },
};
let resp = await userModel.findOne<IExpectedResults>(query);

Get All

let query = {
  where: {
    username: {
      eq: "test",
    },
  },
};
let resp = await userModel.findAll<IExpectedResults>(query);

Update One

let query = { where: { id: { eq: 1 } } };
let newFields = {
  username: {
    default: "newUsername",
  },
  perms: {
    special: JSON.stringify({ test: true }),
  },
};
let resp = await userModel.updateOne(query, newFields);

Delete

let query = { where: { id: { eq: 1 } } };
let resp = await userModel.delete(query);

Create One

let newFields = { username: { default: "test" } };
let resp = await userModel.createOne(newFields);

FAQs

Package last updated on 28 May 2022

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