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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hyjs/tauri-sql-orm

v0.1.6

Published

tauri-plugin-sql-api's ORM encapsulation provides a convenient and versatile way for developers to interact with SQL databases in their Tauri applications.

Readme

tauri-sql-orm[experimental]

Description of tauri-plugin-sql-api's ORM encapsulation

The tauri-plugin-sql-api is a powerful plugin that allows developers to easily access SQL databases in their Tauri applications. One of the key features of this plugin is its ORM encapsulation, which provides a convenient and intuitive way to work with database records.

With the ORM encapsulation, developers no longer need to write raw SQL queries to interact with their database. Instead, they can use the provided API methods to perform operations such as creating, reading, updating, and deleting records. The ORM encapsulation also handles data validation and type conversion, ensuring that only valid data is stored in the database.

Furthermore, the tauri-plugin-sql-api's ORM encapsulation supports multiple database types, including MySQL, PostgreSQL, and SQLite. This makes it a versatile tool for developers working with different database technologies.

Overall, the ORM encapsulation feature of the tauri-plugin-sql-api simplifies database management and improves application scalability by providing a high-level, object-oriented interface to work with database records.

Install dependencies

npm i @hyjs/tauri-sql-orm -S

#or yarn

yarn add @hyjs/tauri-sql-orm -S

#or pnpm

pnpm i @hyjs/tauri-sql-orm -S

USE

instantiation

// sqlite
const db = new SqlORM('sqlite:db.db');

// mysql
const db = new SqlORM('mysql://user:pass@localhost:3306/db');

// postgres
const db = new SqlORM('postgres://user:pass@localhost:5432/db');

create model

import { DataTypes } from '@hyjs/tauri-sql-orm';

const TestDB = await db.define('test', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  name: {
    type: DataTypes.TEXT,
    allowNull: false
  },
  text: {
    type: DataTypes.INTEGER,
    allowNull: false
  }
});

Automatically create a table

TestDB.sync();

If you need to create the table, you may need to use force.

The force will delete before the table and then recreated

TestDB.sync({ force: true });

create data

await TestDB.create({
  name: 'test',
  text: 1
});

bulkCreate data

await TestDb.bulkCreate([
  {
    name: 'test',
    text: 1
  },
  {
    name: 'test',
    text: 1
  }
]);

findAll

await TestDB.findAll();

findOne

await TestDB.findOne({
  name: 'test'
});

drop table

await TestDB.drop();