Code Monkey home page Code Monkey logo

mysql-shadow's People

Contributors

perak avatar

Stargazers

 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

mysql-shadow's Issues

Error on vanilla app

Hey, trying to test this out but i get

I20141103-00:02:37.867(2)? Connected. Initializing shadow...
=> Meteor server restarted
I20141103-00:06:39.017(2)? Shadow initialized. Copying data to mongo...
I20141103-00:06:39.026(2)? Success.
W20141103-00:06:39.072(2)? (STDERR)
W20141103-00:06:39.073(2)? (STDERR) /Users/user/.meteor/packages/perak:mysql-shadow/.1.0.3.mfxqt7++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/Parser.js:82
W20141103-00:06:39.073(2)? (STDERR)         throw err;
W20141103-00:06:39.074(2)? (STDERR)               ^
W20141103-00:06:39.105(2)? (STDERR) Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
W20141103-00:06:39.105(2)? (STDERR)     at Object.Meteor._nodeCodeMustBeInFiber (packages/meteor/dynamics_nodejs.js:9)
W20141103-00:06:39.105(2)? (STDERR)     at _.extend.get (packages/meteor/dynamics_nodejs.js:21)
W20141103-00:06:39.106(2)? (STDERR)     at withoutInvocation (packages/meteor/timers.js:4)
W20141103-00:06:39.106(2)? (STDERR)     at bindAndCatch (packages/meteor/timers.js:13)
W20141103-00:06:39.106(2)? (STDERR)     at Object._.extend.defer (packages/meteor/timers.js:68)
W20141103-00:06:39.107(2)? (STDERR)     at Object.AppConfig.configurePackage (packages/application-configuration/config.js:134)
W20141103-00:06:39.107(2)? (STDERR)     at Object.<anonymous> (packages/mongo/remote_collection_driver.js:30)
W20141103-00:06:39.108(2)? (STDERR)     at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750)
W20141103-00:06:39.108(2)? (STDERR)     at Query._callback (packages/perak:mysql-shadow/mysql-shadow.js:151)
W20141103-00:06:39.108(2)? (STDERR)     at Query.Sequence.end (/Users/user/.meteor/packages/perak:mysql-shadow/.1.0.3.mfxqt7++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)

what to look for?

Crash - MySQLShadowSyncAll

Hello Perak !
I would like to begin with thinking you for this package that you have published, it seems very interesting !

Trying to use it, I used your code for the startup (I copyied-pasted it and replace the connection information with mine).
Doing this, the app crashes at startup and here's the log I get:

Your app is crashing. Here's the latest log.

Connected. Initializing shadow...
=> Meteor server restarted
Shadow initialized. Copying data to mongo...
Success.

C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\Parser.js:82
throw err;
^
TypeError: Cannot read property 'message' of undefined
at Query._callback (packages/perak:mysql-shadow/mysql-shadow.js:146:1)
at Query.Sequence.end (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\sequences\Sequence.js:96:24)
at Query.ErrorPacket (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\sequences\Query.js:93:8)
at Protocol._parsePacket (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\Protocol.js:270:23)
at Parser.write (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\Parser.js:77:12)
at Protocol.write (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\protocol\Protocol.js:39:16)
at Socket. (C:\Users\Victor\AppData\Local.meteor\packages\perak_mysql-shadow\1.0.8\npm\node_modules\mysql\lib\Connection.js:82:28)
at Socket.emit (events.js:95:17)
at Socket. (_stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
Exited with code: 8
Your application is crashing. Waiting for file change.

I have seen that somebody had had the same issue and that you recommended to try adding the accounts-base package. I tryied but it didn't work for me.

I have also tried to edit a little bit the code (of meteor startup) and it turned out that when I remove the call to the MySQLShadowSyncAll function, the application starts without crashing.

Do you have an idea of something I would have done the wrong way ?

I tryied under windows 7 64bits with meteor 1.1.0.2 and under os x yosemite (last version).

Thanks in advance and thank you again for this package !

Have a nice day.

collection insert duplicate

During Collection insertion on either from the client or to the server via Meteor.methods the mongodb collection data duplicated as you can see here
image

However the data was successfully replicated on the MySQL database as seen here:
image

Replicate changes back to MYSQL

I've been playing with this package since my boss wanted me to use the MySQL as our database but i'm not familiar with MySQL.. I followed usage procedure but got this error..

Exception while invoking method '/Foil_Tank/insert' TypeError: Cannot read property 'skipFields' of undefined
I20150107-10:35:07.242(8)? at Object. (packages/perak:mysql-shadow/mysql-shadow.js:315:1)
I20150107-10:35:07.242(8)? at packages/matb33:collection-hooks/insert.js:27:1
I20150107-10:35:07.242(8)? at Array.forEach (native)
I20150107-10:35:07.243(8)? at Function..each..forEach (packages/underscore/underscore.js:105:1)
I20150107-10:35:07.243(8)? at after (packages/matb33:collection-hooks/insert.js:26:1)
I20150107-10:35:07.243(8)? at Object.CollectionHooks.defineAdvice.self (packages/matb33:collection-hooks/insert.js:40:1)
I20150107-10:35:07.243(8)? at Object.collection.(anonymous function) as insert
I20150107-10:35:07.244(8)? at [object Object].m.(anonymous function) (packages/mongo/collection.js:866:1)
I20150107-10:35:07.244(8)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1599:1)
I20150107-10:35:07.244(8)? at packages/ddp/livedata_server.js:648:1

MySQL auto increment primary key

Hello,
I'm currently developing a meteor app using mysql-shadow. In my MySQL database, I have an "id" field which is automatically incremented. When I insert a row (through a mongo collection) in the MySQL database, the new row gets it's id automatically attributed and everything is fine with that.

Where my problem comes is that in the Mongo collection, there is no "id" field (I'm talking about the id in the MySQL database, not the mongo db uuid) since the document I inserted didn't contain such a field.

My question is the following: is there a particular way to get this id after having inserted the document ? Is there a way to force mysql-shadow to rerun the MySQL to Mongo copy phase runned at startup ?

I have tryied the function "MySQLShadowSyncTable" but it didn't seem to work.

Thanks in advance !

Status

hello.
This sounds like what I was looking for.
Do you plan to continue development?
Regards

Similar project

Hello Petar,

I have been working on a very similar project lately. Originally, I tried replicated MySQL data in Mongo but after digging into DDP deeper, I realized that a subscription could be managed directly. If you would like to take a look: https://github.com/numtel/meteor-mysql

-Ben

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.