Code Monkey home page Code Monkey logo

meteor-sql's Introduction

Meteor SQL

Not compatible with the latest versions of Meteor

This is an initial implementation of Meteor SQL. It currently only supports MySQL.

Features

  • Full server side support of select, insert, update and delete on a table
  • All changes get propagated to all subscribed clients as with MongoDb
  • Changes to the db from other apps are detected immediately (100ms, configurable), and propagated to the client
  • Support for reactive joins through views. Any changes in the underlying tables automatically shows up in the view.
  • Light weight implementation
  • Changes are handled by triggers, no diffs to existing queries needed
  • Polling is done on a single indexed table, very little overhead.
  • includes https://github.com/hiddentao/squel for cleaner query construction
  • Partial support for general select statements. They work correctly, but are not reactive

Limitations

  • Client side the collection still use mongo syntax for find()
  • All tables need to have a unique id
  • Insert, Update and Delete operations on the client don't update the data locally. Instead they run on the server and then the server refreshes the client's data. This could result in slower refresh times, but guarantees that the client always sees data that has been comited to the db. It also means that unlike minmongo, the full range of SQL options are available to the client.

Installation

  • Standard mysql set up
  • Install mysql
  • create database meteor;
  • grant all on meteor.* to meteor@'localhost' IDENTIFIED BY 'xxxxx2344958889d'; #Change the password to something else
  • Now install the mysql client for node.js
  • run meteor in the app's directory so that it builds the hierarchy in the .meteor directory
  • cd .meteor/local/build/server/
  • npm install mysql
  • Change the database config params in server/dbconfig.js to match the password you entered above as well as anything else needed

Implementation Approach

  • insert into the audit trail table information about insert, update, delete
  • poll the audit table
  • When there is a change, publish it using Meteor's standard Meteor.publish
  • Client operations, insert, update, delete use Meteor.call

Future

  • Make select statement reactive
  • Support prepared statements
  • Support any kind of views
  • Provide a way to automatically generate forms

meteor-sql's People

Contributors

bryant1410 avatar drorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-sql's Issues

It doesnt work

I've installed it according to the instruction. But localhost:3000 showed a blank page, the same with pages /client/ and /client/example and even /client/example/main.html. Then I've moved main.html to the app root and also got blank page.
Then I decided to connect to another db and got the error that I don't have a table named 'undefied' in current db.
Also got a bunch of different errors for example - "Object has ho method 'subscribe'"
Killed a day to get it working on my mac. :( But it just doesn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.