Is it Possible to Migrate a Database from SQL Server to PostGresQL using Nhibernate? - sql

Basically, I just want to know if its possible to use Nhibernate to migrate between databases?

No, you must use some other tool to do the migration, and then you can continue to use nHibernate (the level of compatibility will depend on your code)
Tools:
Full Convert
MS2PG

Related

Open source SQL connector for NoSQL (like MongoDB) [duplicate]

After seeing this image:
http://2.bp.blogspot.com/_T-uXeKcGTnM/TIdoKBGwk9I/AAAAAAAABcs/CLW3_cRlN78/s1600/tumblr_kxovt0VLZy1qappj8.png
I wonder is exists any tool for translating SQL querys into MongoDB map/reduce query model??
Larger version of the image: http://rickosborne.org/download/SQL-to-MongoDB.pdf
Update to the question asked in Jan 2011:
A couple of sites exist now to convert sql to mongodb.
Convert MySQL Queries to MongoDB Syntax
http://www.querymongo.com/
And
Convert sql to mongodb
http://klaus.dk/sqltomongodb/
The simple anwser? No.
The slightly more complex anwser is some people have had luck translating more complex SQL to Mapreduce functions ...
http://rickosborne.org/blog/index.php/2010/02/08/playing-around-with-mongodb-and-mapreduce-functions/
http://rickosborne.org/blog/index.php/2010/02/19/yes-virginia-thats-automated-sql-to-mongodb-mapreduce/
However, that said ... generally speaking you might as well learn mapreduce properly because if the data is in MongoDB already ... you'll really need to know how to properly query MongoDB to get anything meaningful done!
MongoDB has wonderful and helpful docs http://www.mongodb.org/display/DOCS/Advanced+Queries
As well as an easy to use online tutorial: http://try.mongodb.org/
The simple answer: Yes. Hibernate OGM - JPA for NoSQL.
JPA is Java API for mapping objects to data stores.
It includes JPQL, a query language similar to SQL which adds the OOP concepts. It's not SQL, but you don't want pure SQL - that was designed for the relational paradigm.
Hibernate OGM proposes to simplify the programming model by embracing JPA/Hibernate APIs and semantics to store data in NoSQL stores like JBoss Enterprise Data Grid instead of the traditional RDBMS. (source)
Also see this Hibernate OGM: JPA for NoSQL talk by Hardy Ferentschik
Recently I happened to see this website mongoquery.com, you can try it.
You can use free sql to mongodb converter like: https://rapidapi.com/ariefsam/api/easy-sql-to-mongodb-aggregation/
Just to add to the last comment
re:The simple answer: Yes. Hibernate OGM - JPA for NoSQL.
JPA is Java API for mapping objects to data stores.
It includes JPQL, a query language similar to SQL which adds the OOP concepts. It's not SQL, but you don't want pure SQL - that was designed for the relational paradigm.
There is a company called UnityJDBC that has released a JDBC driver for Mongo that allows you to run SQL queries against mongo in any java application that supports JDBC.
you can download this driver free at
http://www.unityjdbc.com/mongojdbc/mongo_jdbc.php
hope this helps
You can also http://teiid.org which gives full range of SQL based access to MongoDB. You can use SQL through JDBC/ODBC or use REST/ODATA based access to MongoDB. Teiid uses MongoDB's aggregation framework to provide advanced SQL MongoDB query conversation.

ORM tool to create SQL tables

I need to create a database in SQLite, but I do not want to create the tables manually.
I already have the model of the data I need in the database, and what kind of relationship is each one (many-many, one-many, ...)
I'm wondering if there is a tool that allows me to do that?
I just need the tool to generate the SQL code. Then I will take care of the queries manually using SQL
I was thinking about placing the model in Django, and see what it generates, but there should be a tool not linked to a particular language that allows me to do that. Am I wrong?
Hibernate have the ability to create a scheme from mapped classes. There is support for SQLite.
You can go for dia (see "Tools that generates something from Dia diagrams" at http://projects.gnome.org/dia/links.html).
Also there is SQL::Translator and DBIx::* that allows reading an schema from YAML, Excel, and other sources, but these are Perl specific.
Good luck
You can use Symfony + Doctrine framework. It can generate SQL queries.
Try this module on CPAN: Parse::Dia::SQL

Looking for guidance on embedded .NET database (such as db4o, NHibernate, or RavenDB)

I have an object model that I want to store using an embedded database. I have so far been looking at db4o, NHibernate to SQLCE (w/ linq), and RavenDB. This would be used in a desktop C# application.
The key features I am looking to leverage are: Linq or similar for queries (no SQL or HQL), Embedded data engine, pocos, poco first model, no install (no registry or similar)
Can any one suggest one? Are the three I am looking at the best choices? Are there other options? Of the three, can anyone recommend one over the other?
Thanks
Well the three suggested databases are very different in their nature. SQLCE with Hibernate as RDBMS with a ORM, db4o as object database and RavenDB as document database. Each of them has its strengths.
SQL CE & NHibernate-Combo
The good:
Extremely good support in tooling, the knowledge and a big community is there
Easy to upgrage to MS SQL servers
Extrem good reporting support
The power of SQL
The bad:
Needs mapping
The mapping between the OO and relational world is not easy and can lead to issues with complex models.
RavenDB
The good:
Doesn't need any mapping
Easy to use
Powerful indexing
JSON & HTTP access
The bad:
If your domain doesn't fit to a document-oriented approach, it will be quite painful
It does not support the .NET Framework Client Profile (which is of particular importance as the OP's question is concerning embedded databases)
db4o
The good:
Doesn't need any mapping
Easy to use
The storage model is close the object-model. This also works for very complex models.
-
The bad:
Tooling support is weak.
Afaik all three support LINQ and POCO-first approach. However since NHibernate & SQL CE still need tons of mapping its not as friction free as it could be.
I think if your focus is on POCO first, LINQ-support, ebedded usage and easy to use, I would try RaveDB or db4o.
If your focus is on 'safety', community-knowledge, tool-support and reporting I would go with NHibernate and SQL CE.
Firebird is a terrific embedded database which has long supported all the modern features of an enterprise database:
ANSI SQL
ACID
Stored procedures
Triggers
You can get the .NET provider (last updated May 24th according to the site) and it supports Entity Framework and Linq.
See this question. For LINQ support, check out DbLinq, or since you already intend to use NHibernate you can use NHibernate's own LINQ provider.

What to use for a flexible data access layer - OLEDB or...?

I am creating a quick and dirty prototype (C#) of an object-relational mapping tool. I would like to support at least two kinds of databases - one will be Microsoft SQL Server 2005/2008 and the other most probably MySQL.
Is there any way to use a single data base access mechanism for both database engines and what would it be?
Of course, I know that there will be differences in SQL query syntax, but in my case it is not that important - I'll use a tool to generate SQL queries which suit the certain db engine and user will be able to optimize those SQL queries.
The main idea is to have as flexible data provider solution as possible. Can it be done or not and how can it be done easier?
Note that I am not using this for a production system, just for a prototype, but still I'm curious how it is achieved in production OR/M tools - are they using completely separate access mechanism for each data provider or there are something common? And are they using DataReaders or there is some more appropriate way to retrieve data if I intend to transform data to business objects?
Thanks for any ideas, links etc.
Ok, I found it:
http://www.15seconds.com/issue/040127.htm
the solution is to use IDbxxx or Dbxxx as described in msdn.microsoft.com/en-us/library/ms379620(VS.80).aspx
Now I can specify only once what kind of DataProvider I use and then just use Db/IDb everywhere else.
I recommend nhibernate - which does what you want I think.
nhibernate.info

Dynamic LINQ with other databases

Are there any free (gratis) providers for databases other MS SQL (e.g. MySQL or SQLite) that work with LINQ and support dynamic SQL query generation? E.g. table.Count() generates something like SELECT COUNT(*) FROM table and doesn't first load the whole table and then count the rows.
Here is the DBLinq project: http://code.google.com/p/dblinq2007/
DbLinq is THE LINQ provider that allows to use common databases with an API close to Linq to SQL. It currently supports (by order of appearance): MySQL, Oracle, PostgreSQL, SQLite, Ingres, Firebird
Whether these providers execute Count() in the way you describe depends on the quality of the provider, I suppose. Presumably some effort is made at optimization.
See also http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx
Check out ADO.NET Entity Framework. It supports MySQL via ADO.NET data providers and LINQ to Entities (similar to LINQ to SQL). Being a Microsoft tool, it has good Visual Studio integration and support.
Can you also explain why you want to support these databases?
NHibernate supports multiple databases and has a recently-released Linq provider.