Anyone knows any Linq to XQuery implementation? - linq

the question is basically in the title. Also if anyone has started some kind of implementation but never finished it and is willing to share it, I'm interested! :)
Or if it is being used internally in an open-source project...

I found this while looking for something similar.
Quoting the other post:
Incase anyone is interested.
I'm building a Linq provider for XML columns in sql server.
The Linq provider will translate the query into sql server compatible XQuery code.
Info
Code
This allows you to use sql server like a schema free document DB a'la NoSQL.
Altough the usecase here is not scale but rather the joy of persisting unmapped entities and versioned entities.

Related

Object persistence without ORM or DB Engine

I learned to love how LINQ enables set operations on collections. I'm not saying that I plan to shun traditional RDMBS, because I do need it for reporting. There are NoSQL alternatives out there, but they seem to all need to fire up a separate service.
What I looking for is something local where a DLL can create a database and perform CRUD on it. As mentioned, I'm not going to report out of this, just internal data store. The main application that will be using it is in C#.
I'm hoping that someone can give me a lead. If not, if there is anyone willing, we can start a open-source project for it. I'm not interested in commercial products.
Thanks,
You can run RavenDB in embedded mode inside your .NET application - no need for external services or anything.
And RavenDB supports Linq....

Is it possible to use LINQ to SQL with Oracle?

I need to develop a program that must delete and insert data into an Oracle database. Is it possible to use LINQ to SQL with Oracle?
For development I use MS SQL server but it will be a Oracle database in production. What do you recommend?
Officially No. Linq to SQL was originally build with the ability to swap out the data provider to allow connections to other databases, but they disabled this functionality in the released versions to encourage people to use more stable and supported data access layers (like EF). The recommended approach is to use Entity Framework if you want to switch between SQL and Oracle.
Also, Patrick is very right, make sure you are developing and testing against the same database platform you are going to use in production, there is a world of difference in how they operate. Sure, you should be able to abstract it away to not care about whether you are using SQL or Oracle, but that is almost never really the case.
No, you can't. Although LINQ to SQL was initialy designed with multi-database support in mind (you can see this when looking at the code using .NET Reflector) using a provider model, this model was never made public and Microsoft has no intensions in adding multi-database support to LINQ to SQL.
If you need multi-database support, please use Entity Framework.
No, LINQ-to-SQL doesn't support Oracle. Internally, the project had support for multiple back-ends, but this never made it into the final public release. I believe LINQ-to-Entities supports other databases.

Fluent NHibernate mapping for UDT Oracle Objects

As a predefined conditions I have multiple database sources to deal with.
Also I have a UDT – user defined types objects in part of this databases ( the UDT’s also have children inside) .
As a methodology I am a believer of using the ORM-object relational mapping to connect to DB’s .
In the past I’ve successfully implemented Fluent NHibernate library to connect to Oracle.
I’ve found a workaround for the Multiple Databases , even though the solution may be more elegant in future.
Nevertheless , I still can’t find a solution for mapping the UDT’s .
I think that it should be something like implementation of IUserType or ICompositeUserType .
If there is a known framework presenting option for a full ORM , including UDT’s handle it also can be a solution in our case.
I’ve checked out the EF of oracle (that is very premature) and also DevArt (that doesn’t handle UDT’s) as a possible solutions.
The ODP.Net is the only possible way right now and it’s not too friendly for the developers to use – no LINQ support , no context to begin with.
If you or any of your colleagues can help with some samples of the implementation of this kind of mapping it will be very appreciated.
I feel your pain, working with ODP.NET is not a pleasant experience at all. DevArt dotConnect supports UDT's. DevArt Objects documentation

MVC + ORM, generating reports

I've just started using Zend Framework and Doctrine as its ORM, and I have some doubts regarding the model. It's obvious that the purpose of the ORM is just to map my domain model to database model, but I'm curious how you would model various reports needed on a Web application?
From my point of view, and correct me if I'm wrong, I should avoid writing any queries in the controller (Doctrine Query Language queries, in this case). So, if I want some arbitrary report (e.g. revenue per department, split by month), should I have a special reporting "service" in the domain? This service would fetch my report from the database using ORM queries.
If you could shed some light on this topic, I'd be grateful.
For sure, sometimes DQL is insufficient. In Doctrine2 you can extend it. But Doctrine 1.x is not stupid and you can use native SQL with it: http://www.doctrine-project.org/projects/orm/1.2/docs/manual/native-sql/en
If ORM is insufficient, you can use native SQL. Reporting is the case where SQL queries become tooo complex for ANY simple QL you can image. So... I say go for native queries if you can't avoid it. But save Doctrine for everything else.

Is there a Way to use Linq to Oracle

I can connect with the DataContext to the Oracle database however I get errors in running the query against the oracle database. I looked at the SQL generated and it is for MSSQL and not Oracle PSQL.
Does anybody know of a decent easy to use wrapper to use LINQ against an Oracle Database?
No, LINQ to SQL is very much MS SQL only - think of it as a client driver.
Microsoft is/was helping Oracle and DataDirect develop providers for Oracle and other non-MS database servers.
We use the OraDirect driver from Devart. It includes ADO.NET Entity framework support. You can download a trial version here. You may then use LINQ to entities or entity SQL on top of this.
The pricing of this is quite developer friendly, you pay per developer seat and you may use it however you like.
Another big advantage of this driver is that you can use it without installing an Oracle client, this is a big plus and worth the price alone.
#Greg: We evaluated the datadirect drivers as well, but the performance was poor and cost astronomical.
Edit: It seems DevArt announced a beta with LINQ support recently
One thing you might look into is that there is now LINQ to Entities, which leverages the MS Entity Framework, which I believe is DB agnostic. I'm still looking into how it works myself, but if you could create an ADO.NET Data Entity that interfaces with Oracle, you could then use LINQ against that Entity.
There's also Lightspeed which has a per-organization (not per-developer) license scheme and seems to have a pretty solid documentation library and a free trial version (up to 8 entities). I'm checking this out presently.
After a long search I found DbLinq and should do the trick. I am going to try it myself. I came across your question because I was searching for the same solution. Hope it helps.
Do look at Linq to entities though. I have a datareader populate a collection of objects that are mapped to the oracle table. I can use linq to query that collection in very powerful, simple, and easy ways. I love it. Highly recommend.
Try Devart LinqConnect. This product allows you to work with Oracle, etc.
Why not try ALinq ? http://www.alinq.org
Look in codeplex:
Linq To Oracle project
Not an easy way, at least until a good provider is produced.
Really MS should provide at least an OLEDB Linq provider. After all, Linq to Sql is basically an implementation of IQueryable with designer support.
Another cross-database solution that works fairly well across Oracle, SQLite, MySQL and SQL Server is eXpress Persistent Objects

Resources