Locomotive with mysql - mysql

I am planning to use Locomotive for a project...But as the official website says it cannot work with MySQL. However my requirement is to use it with MySQL.
Has any one used it with mySQL? Any pointers or advises would be great. Thanks.
Cheers,
Abi

Locomotive uses Mongoid - which is an ORM for MongoDB. As such, you cannot use it with MySQL at all, since it leverages some features (dynamic attributes), which traditional RDBMS databases (such as MySQL) do not support.
That being said, MongoDB is pretty easy to install, so if you can get around your requirement of MySQL, then you should have no problems.

Decoupling Locomotive from MongoDB would be no small task at the moment, which is not to say that it is impossible.
Regarding your requirement of MySQL, if you are working on incorporating Locomotive into a larger web-application, one thing to consider is that your non-Locomotive models can still live in MySQL regardless of where Locomotive keeps its data.

From what i know it wont be possible to use locomotive only with mysql as it use heavily mondodb.
However it's not a problem to build your app living together with locomotive and use what ever orm you like.
Just configure your database.yml and the magic will happend ;)
cheers,
Gregory horion

Related

Can I connect to SQL with Node.JS without an external package, or with one universal package?

I know it may be reinventing the wheel to some extent, but I'm creating a package of my own in Node.JS where I would like to keep dependencies to an absolute minimum. This program should connect to SQL (at first, just MySQL, but eventually several different flavors, so if the same answer applies to PostgreSQL, MSSQL, etc. a note about that would be much appreciated) and be able to run queries and such. Is there a way to do so through Node without using an external package like mysql or mssql?
I do understand that this sounds very impractical, and so I see the need to use "fully debugged open-source software" as the commenter put it. However, requiring a new package for every SQL flavor I extend my program to would be impractical as well. If I must install a package, is there some sort of universal one that I can use for Node.JS (something like PDO in PHP)? If so, what is the basic way of connecting to, say, MySQL?
Thanks in advance.
Node has RDBMS-specific packages like mysql, pg, sqlite3, mssql, ibm_db, oracledb, ... all the same except where they aren't.
The php world boasts a couple of database abstraction layers that can talk to multiple makes and models of RDBMS. For Java, JDBC serves the same purpose.
The npm ladc package is a similar project for nodejs; it uses the existing packages for connecting to databases. It seems to be in an early version and not heavily used, according to its npm page.
Sequelize is an object-relational database abstraction above some RDBMSs. If you are able to use an object-relational model for your data, it's probably a good choice. If you're using lots of pure SQL, ladc might make sense.
It seems as if you're blazing a trail with your project.

Adding MySQL functionality in LabView

I am new to LabVIEW and trying to make a small project. In LabVIEW from one device, I am measuring some values and then need to store them in database. Initially, I used Excel to store data. But now I need to add MySQL functionality to store data and then later retrieve when need for analyzing.
I look for NI toolkit but it is expensive. I need some free and open source solution for my project.
I search over SO and google to find any examples where I can start and make it work, but I couldn't find any.
If someone suggest me some resources or having some example code that I can use to achieve my goal. thanks in advance.
Take a look at LabSQL. This works in LabVIEW 2017, allowing connection to a MySQL database without NI's LabVIEW Database Connectivity Toolkit.
I normally use the Database Connectivity Toolkit, but I did confirm I could get this to work in 2017 as well (though connecting to a MSSQL database instead of MySQL).
The only thing that tripped me up at first was not using the Create Connection before Open Connection (because I was used to the aforementioned toolkit). I didn't try anything complicated; I just ran a simple selection query. But it looks like everything should work pretty similarly to the toolkit. As adambro said, if you have a more specific question, maybe we can help with an answer.
I would suggest you could use SQLite. It is a fairly easy toolkit. You can download it via the VI package manager. By dr. James Powell. SQLite is excellent in storing data locally.
Use the SQLite browser from sqlitebrowser.org.
Also a nice way to learn SQL!

What components to use when connecting to a mySQL Database on a webserver

I, want to develop an application that can access my database on my website. I want to know what components can I use to access, insert and update records in my database. Im using a mySQL database on a unix server. The application will be running in windows.
Without understanding well what you mean by what components you need (other than TDataset et all), all I can do is to refer you to this article:
How to set up the dbGo (ADO) ConnectionString for mySQL database
If you have some cash available, I heartily recommend you get the AnyDAC components. I've heard that the DevArt components are also good, but I have no experience with them.
I would highly recommend http://www.devart.com/unidac/ very easy to setup and it supports multiple databases.
We've been using them for over 2 years and we're very comfortable with it.
AnyDac is the best and it's definitely worth buying. I've had plenty of experience with multiple components (AnyDac,UniDAC,SQLDirect,SDAC) and AnyDac has proved its value.
In comparison Anydac is faster, you have the ability to scale up your application to N-tier, supports more systems, has Free Pascal support.

How good is Rails and PostgreSQL support?

I am thinking of working on a Rails application that uses PostgreSQL. I have some questions before I am comfortable using Rails:
Is PostgreSQL support in Rails less superior than, say, MySQL.
Would it feel any different if using PostgreSQL?
Are there any cases where using PostgreSQL fail to work?
Thanks.
After having used sqlite, mysql and postgresql with Rails, I prefer using postrgresql.
Installation for OSX, Ubuntu and Windows went well as opposed to buggy installs for other DBs.
I had to install the following gem to use postgresql:
install gem postgres-pr
It may "feel" different when you come across complex databse requests where you add in special conditions such as extracting the month from a date as the actual text will differ depending on the database system. Also, postgresql delimits strings in request with E'' so sometimes a request using a text-field may come up with an error if you're not careful with your :conditions => [].
PostgreSQL support with rails is excellent - I would not hesitate to use it.
If you are looking for examples, Planet Argon is a high-profile web development house that primarily does Rails with PostgreSQL in the background. You can read more about their work at Robby Russel's blog.
Heroku uses PostgreSQL exclusively for their Ruby web hosting - including lots of Rails deploys, of course.
At my employers we use PostgreSQL exclusively, for a large Rails application. We use complex queries etc and so far had no problem with Rails & Postgres itself.
However, if you rely a lot on 3rd party plugins that work on top or beside ActiveRecord, you might want to check their support for Postgres. E.g we ran into inconsistencies using the searchlogic plugin.
Postgres support is very good, albeit support for writing plpgsql functions, triggers and composite primary keys inside migrations leaves much to be desired.

how do you ensure database Interoperability

I'm starting a new opensource project (for real estate) and wanted to focus on using MySQL, but would also like to ensure it works in PostgreSQL. What is the best way to doing this without having to continually test in both environments? I'm assuming the db schema is close to the same, but there could be some differences on the SQL script to set up the databases - right? what about scripts?
What Development environment are you using?
if your using .NET, JAVA you could use an ORM(Object Relational Mapper) like Hibernate (NHibernate for .net) and that will take care of you db interoperability, for PHP or ruby I would look for something equivalent.
Edit point:
After looking at your profile it looks like your a python developer so you may find this link helpful what are some good python orm solutions posed on SOF 10 months ago
Seems to me that the only way to make absolutely sure is to target them both in your testing. I'm sure both DB's have development paths that may diverge, and you'll often find yourself faced with the prospect of using some MySQL-specific feature.
It's a PITA but the longer you go between tests against both the better the chance you'll have fireworks when you do.