Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql.js can work with sequelize? #183

Open
keyiis opened this issue Dec 19, 2016 · 5 comments
Open

sql.js can work with sequelize? #183

keyiis opened this issue Dec 19, 2016 · 5 comments

Comments

@keyiis
Copy link

keyiis commented Dec 19, 2016

sql.js can work with sequelize?

@haltcase
Copy link

I'm so surprised this has never been done before, since it's so accessible but so in need of some sugar. This is, however, less a sql.js problem and more a sequelize problem ( as well as other sql ORMs / layers like knex ). Check out #91 - specifically the two replies. Some have made sql.js work with sequelize by patching together an adapter. Give that a try.

@keyiis
Copy link
Author

keyiis commented Jan 2, 2017

@citycide i tried,but not work,i hope sql.js can give a offical example in document.

@haltcase
Copy link

haltcase commented Jan 17, 2017

It's not sequelize, but it might be useful anyway - I've just put out a 1.0 rc for a package I've been working on for a while that allows for using sql.js as a knex backend, along with a document store style API.

Trilogy

@KyleGalvin
Copy link

TypeORM has sql.js support.
https://www.npmjs.com/package/typeorm

I know it's not the answer you hoped for, but TypeORM can be used in javascript projects and I personally find it to be the best ORM I've come across in the node ecosystem.

@citycide is right; this is an ORM's feature to add. Sql.js can't do much about the issue directly without getting it's hands dirty in other teams projects.

@catamphetamine
Copy link

Hi. I've made an npm package that could be used to make sql.js to work with Sequelize by mimicking sqlite3's behavior:
https://www.npmjs.com/package/sql.js-as-sqlite3

Usage:

import Sequelize from 'sequelize'
import sqlJsAsSqlite3 from 'sql.js-as-sqlite3'

const sequelize = new Sequelize('sqlite://dbname', {
  dialectModule: sqlJsAsSqlite3
})

Originally based on this gist:
https://gist.github.com/iPotaje/89f48328c682b8a4f6f0b6e3874a6902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants