SQLMongoose

SQLMongoose is a powerful, modern, and easy-to-use ORM for SQLite3, inspired by Mongoose. It's designed to be intuitive for beginners and powerful for advanced users. It provides a simple and elegant way to interact with your SQLite database.
Features
- Easy to use: A simple and intuitive API that feels familiar.
- Powerful Query Builder: Chainable query builder for complex queries.
- Schema Validation: Define schemas for your models and validate your data.
- Hooks: Execute middleware functions before or after operations.
- TypeScript Support: First-class TypeScript support out of the box.
Installation
npm install sqlmongoose
Quick Start
Here's a quick example to get you started:
import { sqlmongoose, Schema, DataTypes } from 'sqlmongoose';
await sqlmongoose.connect(':memory:');
const userSchema = new Schema({
name: { type: DataTypes.STRING, required: true },
email: { type: DataTypes.STRING, unique: true },
age: { type: DataTypes.NUMBER, default: 0 },
});
const User = sqlmongoose.define('User', userSchema);
const user = await User.create({
name: 'John Doe',
email: 'john.doe@example.com',
age: 30,
});
console.log('User created:', user);
const users = await User.find().where('age', '>', 25).execute();
console.log('Users older than 25:', users);
Documentation
For more detailed information and advanced usage, please check out the documentation.
Examples
You can find more examples in the examples directory.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT