Using Miniprofiler with Neo4j Graph DB - neo4j

I'm playing around with Neo4j community edition, with Neo4jClient for .net, and looking for a way to use the great Miniprofiler for the calls to the Neo4j DB.
I'm using the miniprofiler on some other projects with SQL Server and Entity Framework and getting wonderful insights about the queries sent to the DB. Wondering if I can get the same with Neo4j and Cypher queries.

The answer is No and Maybe.
No, as it doesn't exist at the moment.
Maybe as you could either have a stab at writing it yourself, or add it as a feature request to the Neo4jClient GitHub page and we can have a look about doing it in the future, but obvs it comes after bolt and a few other things.

Related

Getting SQL queries generated with Entity Framework Plus?

I am enjoying the features of Entity Framework Plus over Entity Framework 6 since a few hours, and especially its IncludeFilter.
With regular Entity Framework 6, I was able to simply call ToString() on an IQueryable to easily get the SELECT query that will be actually processed on DB Server.
But with EF+, when I apply an IncludeFilter, I only get :
Z.EntityFramework.Plus.QueryIncludeFilterParentQueryable`1[MyRecord]
Because ToString() seems to not be overloaded the same way in EF+.
Is there a way to get SQL generated for "IncludeFilter" queries as well as for classical queries ?
I know I could get it on SQL server itself with the adequate profiling tools, but I would like to be able to do it on code side in EF.
Is there a way to get SQL generated for "IncludeFilter" queries as well as for classical queries ?
No, there is currently no way.
It might come later but at this moment, the library doesn't offer this feature.
(I'm the owner)
EDIT: Answer comment
My main worry was to know if the generated queries are optimized
I would not call them optimized. They are generated by Entity Framework and nothing is really modified on our side.
IncludeFilter: Create one VERY big query like Include does in EF6
IncludeOptimized: Create multiple small queries like Include does in EF Core
Maybe a little late but you could use SQL Server Profiler to trace database events (e.g., queries). Using SQL Tuning profile it will trace your queries and you can have a look at them in SQL.
You can use the current context's log to track all requests performed under this instance
context.Database.Log = s => Console.WriteLine(s);

How to calculate number of database queries in a MVC project?

We calculate the no. of db queries in ASP.NET application by searching for ".fill(" or ".execute" and then looking for the query/stored proc.
What is the way we can find the no. of db queries in an MVC application?
This is as part of application analysis...
I don't know much about your application but I would try to do the following:
use SQL profiler to see which queries are executed
create a web crawler to get a list of all links in the application
click on each link (by hand or from the code) and analyze results from SQL Profiler
Search for "DbContext" in the entire solution.
This will take you to the controller.
Within the Method inheriting from dbcontext, you get name of all the DbSets.
Then you can search for each "DbSetName" which will lead you to the LINQ query!

Custom queries with Breeze JS (Fiql + Breeze)

Im new to breeze js, I understand that breeze has it's own query language related to OData
But I am trying to get breeze js working with a custom query language, as an example FIQL is
one of the form to make queries to backend, can we get breeze run with this type of query language.
Overview of FIQL :-
http://jaxenter.com/tutorial-smarter-search-with-fiql-and-apache-cxf-46876.html
(this is not a technical answer, at the very most it's an advice)
As mentionned from their website documentation :
Today, out of the box, the Breeze product ships with adapters for the
ASP.NET Web API and for OData. It also ships with .NET components that
interface with the Entity Framework and that generate Breeze metadata
from an Entity Framework model; that EF model could be developed code
first or database first. The Breeze client is in no way limited to
these technologies; they are merely the first backend components
available; we’d be thrilled to help you adapt Breeze to your preferred
server stack.
First question is whether
1) you want breeze to actually create FICL queries on the client and send them to a FICL service. This involves translating a client side breeze EntityQuery into FICL url syntax. If so you would need to create a new a 'uriBuilder' adapter.
2) you want to translate a breeze query already sent to your service into FIQL syntax on the server so that you can further refine the query and then send it on to your FICL service. If so you would need to create a breeze DataService endpoint.
Both of these are certainly possible.
If you are looking at the 1st option, take a look at the 'b000_uriBuilder.xxx' files in the breeze GitHub repo under the 'src' directory. There should be two 'uriBuilder.xxx' files, one which translates an EntityQuery into OData syntax and another that translates the EntityQuery into a new 'json' query syntax. There is also additional information on this 2nd syntax here:
http://www.getbreezenow.com/documentation/query-using-json
Both of these 'uriBuilder's make use an internal 'visitor' framework that we have not yet documented but should be reasonably understandable by looking at the source.
If you are looking at the 2nd option, I would recommend looking at the link mentioned above and then taking a look at the 'breeze.node.js' repo and the 'breeze-sequelize' subdir within it. In this repo we take a serialized server side breeze EntityQuery and translate it into a 'Node' Sequelize query that we can apply to a variety of backends.
Another option is to contact our professional services arm, at breeze#ideablade.com and ask them to assist in building the adapters for you or to ask for more detailed technical help.

Replace sql server with RavenDB

I have a silverlight application that communicates with the sql server database. The server side is a WCF RIA webservices that use EF 4 for persisting data back to db.
I am considering switching to RavenDB for two reasons
Scalability
Freedom from updating schema on production server.
My questions
How easy it is to switch to RavenDB. Is it as easy as pointing the connection toRavenDB.
Will it create a schema automatically by inspecting the entities.
can i continue to use linq in wcf. Or do i need to replace code in it?
Thanks,
Ankur
No. It will most likely require a model change since a model suited from RavenDB is usually very different from a relational model you're likely to be using now.
There is no schema with RavenDB.
Yes, but you'll probably need to rewrite the queries to match the new document-oriented model that you'll come up with for using RavenDB.

Breeze Save - Error: CROSS APPLY is not supported by Oracle

I am saving a complex object graph from breeze, and I get the following error from the server:
Error: CROSS APPLY is not supported by Oracle
We are using an Oracle database using Devart provider. From my research, it seems that the only solution to this problem is to avoid certain linq query expressions. These threads provide further context:
http://forums.devart.com/viewtopic.php?t=18849
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/ae826dd9-1bab-4f64-a7ee-f082a2177346/
The last thread linked is particularly disheartening, as this appears to be a Microsoft-related EF issue on which they have gone dark on for quite some time.
Since the only remedy for this appears to be avoiding specific linq operators/expressions, I must ask if there is any way to use breeze and avoid these offending linq expressions? If not, I am lead to conclude that breeze is currently limited only to relational databases that are fully-supported by EF, which from the my research is effectively only MS SQL.
Hoping I am wrong,
Mathias
If you want to use Breeze's EFContextProvider then you are limited to using an EF backend. However you do some other options. The first is that you can pass your own parameters into your controller methods, ( see the EntityQuery.withParameters method). This may allow you to rewrite your expression on the server to avoid EF expressions that cannot be tranlated properly for Oracle.
In addition, you can use Breeze with your own custom context provider or you can take over the server side completely. The first is a good approach if you are talking to another .NET backend, the second is appropriate when you are talking to an arbitrary non .NET backend.
We are planning on releasing an NHibernate backend to breeze as well as a Node-MongoDb backend within the next few weeks to illustrate both of these.

Resources