![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
H-orm is a mysql orm for nodejs
H-orm is also meaning happy and easy to use
Here is an example how to use h-orm
const horm = require('h-orm')
horm.connect({
limit: 10,
host: '127.0.0.1',
port: '3306',
database: 'test',
user: 'your username',
password: 'your password',
debug: true
})
const StudentModel = horm.model('teacher', {
name: String,
sex: Number,
});
(async () => {
console.log(await StudentModel())
console.log(await StudentModel().find(1))
console.log(await StudentModel().create({sex: 0}))
console.log(await StudentModel().delete({sex: 0}))
console.log(await StudentModel().update({sex: 0}, {id: 1}))
})()
Create a mysql connect pool, you can set follow setting
{
limit : 10 // default 10, pool max connect num
host : '127.0.0.1',
port : '3306',
user : 'your username',
password : 'your password',
database : 'your database',
debug : true // trun on this debug you will see all sql
}
You will get a model instance after use model function
const hormInstance = horm.model('student', {
name: String,
sex: Number
})
How about exInfo?
You can use exInfo set some default setting
{
status: 'status', // when use delete , really change field ( 0 || 1) , 'status' is default value
pri: 'id' // table pri, 'id' is default value
}
Get all schema from table
(async () => {
await hormInstance()
})()
Create one data or more
(async () => {
await hormInstance().create({name: 1})
await hormInstance().create([{name: 1}, {name: 2}])
})()
Delete some data which name = 1 or prikey = 1
(async () => {
await hormInstance().delete({name: 1})
await hormInstance().delete(1)
})()
Update data
(async () => {
await hormInstance().update({name: 1}, {sex: 0})
})()
Find prikey = 1 or prikey in (1,2,3)
(async () => {
await hormInstance().find(1)
await hormInstance().find([1,2,3])
})()
Find info which include serachData (suport like)
(async () => {
await hormInstance().where({sex: 0})
await hormInstance().where({sex: [0, 1]})
await hormInstance().where({sex: 0, name: '%n'}, 'OR')
await hormInstance().where({name_like: '%ma%'}) // SQL LIKE
await hormInstance().where({name_not_like: '%ma%'}) // SQL NOT LIKE
})()
Use SQL like syntax Find info which include serachData
(async () => {
await hormInstance().like({name: '%ma%'})
await hormInstance().like({name: 'm%'})
await hormInstance().like({name: '%n', sex: 1}, 'NO', 'OR'))
})()
Sort your data
(async () => {
await hormInstance().sort({key: 'name': rule: 'ASC'})
await hormInstance().sort([{key: 'name': rule: 'ASC'}, {key: 'sex': rule: 'DESC'}])
})()
Return limit result
(async () => {
await hormInstance().limit(10) // get 0-9
await hormInstance().where({sex: 0}).limit(1)
await hormInstance().where({sex: 0}).limit(0, 5) // get 0-4
})()
MIT
FAQs
H-orm is a mysql orm for nodejs
The npm package h-orm receives a total of 2 weekly downloads. As such, h-orm popularity was classified as not popular.
We found that h-orm 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.