KSDaemon / Sails Hook Sequelize
Licence: mit
Sails.js hook to use sequelize ORM
Stars: ✭ 60
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Sails Hook Sequelize
Gorose
GoRose(go orm), a mini database ORM for golang, which inspired by the famous php framwork laravle's eloquent. It will be friendly for php developer and python or ruby developer. Currently provides six major database drivers: mysql,sqlite3,postgres,oracle,mssql, Clickhouse.
Stars: ✭ 947 (+1478.33%)
Mutual labels: orm
Tripod
ActiveModel-style Ruby ORM for RDF Linked Data. Works with SPARQL 1.1 HTTP endpoints.
Stars: ✭ 56 (-6.67%)
Mutual labels: orm
Zeeql3
The ZeeQL (EOF/CoreData/AR like) Database Toolkit for Swift
Stars: ✭ 29 (-51.67%)
Mutual labels: orm
Hibernate Basics
Samples for "Hibernate, how the magic is really done?" talk
Stars: ✭ 44 (-26.67%)
Mutual labels: orm
Hunt Entity
An object-relational mapping (ORM) framework for D language (Similar to JPA / Doctrine), support PostgreSQL and MySQL.
Stars: ✭ 51 (-15%)
Mutual labels: orm
Nextjs Sequelize
Next.js With Sequelize Web Application, a Full-Stack Web App Development Boilerplate. https://medium.com/@defrian.yarfi/next-js-with-sequelize-web-application-a-full-stack-web-development-a0051074e998
Stars: ✭ 21 (-65%)
Mutual labels: orm
Reform
A better ORM for Go, based on non-empty interfaces and code generation.
Stars: ✭ 1,103 (+1738.33%)
Mutual labels: orm
Turbulette
😴 Turbulette - A batteries-included framework to build high performance, fully async GraphQL APIs
Stars: ✭ 29 (-51.67%)
Mutual labels: orm
Factory Bot
🤖 Provides a fixture factory for doctrine/orm entities.
Stars: ✭ 57 (-5%)
Mutual labels: orm
Kotgres
SQL generator and result set mapper for Postgres and Kotlin
Stars: ✭ 21 (-65%)
Mutual labels: orm
Mongo Thingy
🍃 The most idiomatic and friendly-yet-powerful way to use MongoDB with Python
Stars: ✭ 49 (-18.33%)
Mutual labels: orm
Objectivesql
ObjectiveSQL is an ORM framework in Java based on ActiveRecord pattern, which encourages rapid development and clean, codes with the least and convention over configuration.
Stars: ✭ 1,109 (+1748.33%)
Mutual labels: orm
Fluent
Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
Stars: ✭ 1,071 (+1685%)
Mutual labels: orm
sails-hook-sequelize
Sails.js hook to use sequelize ORM
Installation
Install this hook with:
$ npm install sails-hook-sequelize --save
Configuration
.sailsrc
{
"hooks": {
"orm": false,
"pubsub": false
}
}
Also you can set some parameters in config/sequelize.js
to override defaults.
module.exports.sequelize = {
"clsNamespace": "myAppCLSNamespace",
"exposeToGlobal": true
};
Connections
Sequelize connection.
Important note: dialect
keyword MUST be present in connection or connection.options.
somePostgresqlServer: {
user: 'postgres',
password: '',
database: 'sequelize',
dialect: 'postgres',
options: {
dialect: 'postgres',
host : 'localhost',
port : 5432,
logging: console.log // or specify sails log level to use ('info', 'warn', 'verbose', etc)
}
}
Models
Sequelize model definition models/user.js
module.exports = {
attributes: {
name: {
type: Sequelize.STRING,
allowNull: false
},
age: {
type: Sequelize.INTEGER
}
},
associations: function() {
user.hasMany(image, {
foreignKey: {
name: 'owner',
allowNull: false
}
});
},
defaultScope: function() {
return {
include: [
{model: image, as: 'images'}
]
}
},
options: { // Options must exists (even if empty) in order to consider this model a Sequelize model
tableName: 'user',
classMethods: {},
instanceMethods: {},
hooks: {},
scopes: {},
},
connection: 'NotDefaultModelsConnection' // Can be omitted, so default sails.config.models.connection will be used
};
Contributors
This project was originally created by Gergely Munkácsy (@festo). Now is maintained by Konstantin Burkalev (@KSDaemon).
License
Thanks JetBrains for support! Best IDEs for every language!
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].