Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ormize
Advanced tools
Readme
ORMize is a TypeScript-developed Object-Relational Mapping (ORM), but can also be used in JavaScript. Its goal is to ease the interaction between applications and databases, allowing developers to work with data using objects instead of writing SQL code.
Currently, ORMize only supports the MySQL database, but I plan to add support for more databases in the future.
To install ORMize, you can use npm:
npm install ormize
To use ORMize, you need to set up the connection to the database and create your model classes.
import { Connection } from 'ormize';
const connection = new Connection({host: "localhost", user: "root", port: 3306, database: "orm"});
console.log(connection.isConnected());
import { Model, Types } from 'ormize';
class User extends Model {
static tableName = "users";
static fields = {
id: {type: Types.INTEGER, primaryKey: true, autoIncrement: true},
name: {type: Types.STRING, allowNull: true},
age: {type: Types.INTEGER, allowNull: true},
email: {type: Types.STRING},
password: {type: Types.STRING},
};
static connection = connection.getConnection();
}
//Synchronizing the model with the database
User.sync();
//Getting all users
const users = await User.find();
//Getting a user by id
const user = await User.find({
where: {
id: 1
}
});
//Getting a user by email limiting by 1
const user = await User.find({
where: {
email: "Jhon@jhon.com"
},
limit: 1
});
I am always looking for contributions to ORMize. If you find a bug or want to suggest a new feature, please open an issue on GitHub. If you want to contribute to the code, please send a pull request. Please, check the CONTRIBUTING file for more information.
ORMize is licensed under the MIT license. You can find the license in LICENSE
FAQs
JSO-SQL (JavaScript Object-Relational Mapping - SQL)
The npm package ormize receives a total of 0 weekly downloads. As such, ormize popularity was classified as not popular.
We found that ormize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.