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.
easyorm
Advanced tools
Readme
Easyorm is a promise-based Node.js ORM for Postgres, MySQL, SQLite and Microsoft SQL Server.
npm install easyorm
The following types of data can be defined in easyorm: STRING, INT, UINT, SHORT, USHORT, LONG, ULONG, ARRAY, OBJECT, LIST, MAP.
Among them, STRING, INT, UINT, SHORT, USHORT, LONG, ULONG, ARRAY are simple types, divided in the main table.
OBJECT is defined as the package type, itself does not participate in the division, but OBJECT elements involved.
The LIST, MAP is treated as a complex type, divided in the sub-table.
It should be noted that the ARRAY, LIST difference, ARRAY elements must be simple type, LIST elements apply to all types.
In addition, "_key" for LIST and MAP must be simple type.
Using the above data types, you can easily define the data structure, like this:
{
"_type": "OBJECT",
"_value": {
"name": {
"_type": "STRING"
},
"age": {
"_type": "USHORT"
},
"school": {
"_type": "OBJECT",
"_value": {
"name": {
"_type": "STRING"
},
"address": {
"_type": "STRING"
}
}
},
"courses": {
"_type": "LIST",
"_value": {
"_type": "OBJECT",
"_value": {
"name": {
"_type": "STRING"
},
"book": {
"_type": "STRING"
},
"time": {
"_type": "ARRAY",
"_value": {
"_type": "UINT"
}
},
"teacher": {
"_type": "MAP",
"_key": {
"_type": "UINT"
},
"_value": {
"_type": "OBJECT",
"_value": {
"name": {
"_type": "STRING"
},
"age": {
"_type": "UINT"
}
}
}
}
}
}
}
}
}
Easyorm's API is also very simple, you can create table like this:
let Model = require('easyorm').Model;
let student = new Model('student', schema, config);
student.createTable(function (err) {
});
insert data like this:
student.insert(id, dataObj, function (err) {
});
query data like this:
student.query(id, function (err) {
});
delete data like this:
student.del(id, function (err) {
});
update data like this:
student.update(id, data, function (err) {
});
config database connector like this:
{
"client": "mysql",
"connection": {
"host" : "192.168.68.128",
"user" : "root",
"password" : "123456",
"database" : "test"
},
"pool": {
"min": 0,
"max": 7
}
}
FAQs
Easyorm is a promise-based Node.js ORM for Postgres, MySQL, SQLite and Microsoft SQL Server.
The npm package easyorm receives a total of 0 weekly downloads. As such, easyorm popularity was classified as not popular.
We found that easyorm 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.