Write Breezejs data source provider with Nodejs for MySQL - mysql

I would like to use Breeze with NodeJS and MySQL. Unfortunately, so far I could find no examples of this. I have seen that there is an example of NodeJS + MongoDB. Now I try to analyze the MongoDB provider (mongoSaveHandler.js - [npm install breeze-mongodb]?) to write my own provider for MySQL. Unfortunately I could not find any documentation on how such a provider must be established.
The provider should be able to deal with complex data and navigation properties (one-to-many, etc.) and also save/delete/update them properly in the MySQL database.
The following is an example of how the database structure might look like:
Database Image
My questions are now:
Is there already an example with Breeze (+NodeJS) and MySQL that I could use?
Is there a documentation/sample how to write a own data source provider?
If I'm on my own, what should I look for when I create my provider?

There are plenty of Web API+EF+SQL samples, the Node+MongoDB sample you've already seen, a Ruby+SQL sample, and even a NoDB (and 3rd party data) sample ... but no Node+SQL sample yet.
These docs aren't spot on for your use case, but they will likely point you in the right direction:
ToDo Server
The docs are for Web API+EF+SQL, but good detail on how everything is wired together.
MongoDB
The MongoDB docs as well as the Zza! sample are pretty good about showing how they configured the Node server (to talk with MongoDB, sure, but you can see the process all the same).

Related

How to connect AngularJS with MySQL to save, read and access levels make easy?

I used Firebase before. It was super simple, but It works only with non-relational database. I want to find something similar for MySQL but open source.
I found this two:
https://directus.io/
https://strapi.io/
I can't connect both to my old database or it seems complicated. I also can't find AngularJS integration. I found JavaScript integration for Strapi, but is unmaintained (https://github.com/strapi/strapi-sdk-javascript). If you recommend Strapi or Directus, is there any easy way to connect it to old database and JavaScript sdk?
If you install Directus clean, you can then just import your existing SQL tables/content and it will let you manage it. Should be very quick and easy to setup! There's a whole community on Slack that can help you out on that too:
https://directus.chat
By using Strapi you will not be able to import a database structure and generate automatically the API from it.
After that, in few clicks you will be able to map your Strapi content types (models) on your database table structure.
Let me know if you have any questions.

Can I use GraphQL for mongoDB or mySQL?

I have started learning GraphQL and found that GraphQL is an awesome query language.
However I wonder if I can use GraphQL for existing databases such as mongoDB or mySQL.
Also please explain about prisma.
Is prisma a cloud database or something?
Edit:
TL;DR:
GraphQL can be used with any database as long as the data satisfies the type-strict qualification. Prisma is a node.js/typescript ORM library and works great with GraphQL.
Looking back to this a bit old question, I noticed that the question was so dumb and a bit too wide. So I've decided to add some more thoughts as I'm now quite familiar with GraphQL and Prisma. Hope this could be a help for new developers who are starting to learn GraphQL and Prisma.
GraphQL is a query language that we can use to interact with the API.
Like the REST API, GraphQL is another type of API format where we can use Queries to get data and Mutations to update data.
As the REST API doesn't depend on the database type, GraphQL can also be used with any database as long as the data can be formatted into type-strict models.
On the backend side tho, you need to implement the GraphQL interface that reads data from the database and sends as the Query response, and updates the database with the data from the Mutation.
Prisma on the other hand is a node.js/typescript ORM library - similar to mongoose or sequelize. The benefits of using Prisma is that it auto-generates the TS models and makes it much easier to interact with the database in typescript.
As GraphQL and Prisma are both strict in type usages, they match quite well. Also, Prisma provides an exclusive interface for GraphQL implementation, so you can easily write GraphQL interface with Prisma.
Please check out here for more information on the combination of GraphQL and Prisma: https://www.prisma.io/graphql
It was a long edit, but hope this helps.
As it was mentioned on previous post - yes, you can.
An example, if you backend application wrote on .NET stack - you may use, guess two, main libs that really tested and guys use it in real projects (google GraphQL.Net and second lib should be spelled almost the same)
But, both of these libs give you only processing of graphql queries and describe schemes ("accounts {id name}" means you should define resolver which returns data from db or another data source)
Most of guys use EF (EntityFramework) as a data-adapter between GraphQL and db. But, from my point of view it's useless, especially, if we are talking about get data from db and that may be thousands requests.
We implemented component that based on light-weight DB lib (to almost all popular dbs like MSSQL, Postgresql, MySQL or Elasticsearch), gives ability to configure GraphQL scheme very easy and provide main features like sort, pagination and complex filter.
Yes, you can use it with existing DB.
Prisma is an ORM layer build using GraphQL server, it abstracts away the database and let you interact with the database using GraphQL query. It currently supports MySQL, MongoDB, AWS RDS & PostgreSQL. It's not a database, but you can host it on the cloud.
Typically, you need another GraphQL server that inside it resolvers will call Prisma's GraphQL server. This GraphQL server is the one that is called by the client.

Unable to find all issues through SonarQube WS API

Goal: Export all SonarQube issues for a project to JSON/CSV.
Approach 1: Mine the sonar mysql database
Approach 2: Use the SonarQube WS API
First I was motivated to go for approach-1, but having discussion with the SonarQube core developer community I got the impression not to touch the database at any situation.
Thus I proceed with approach-2 and developed scripts to get issues. However, later I found that through WS-API, I can get upto 10000 issues which does not meet my goal.
Now I am convinced that the approach-1 i.e., mining the database is best for me. When looking at the "issues" table in sonar db, I have the following question.
Question. What is the format/encoding of the "location" field and how can I decode it from python/java?
Extracting data from database is not recommended at all. Schema and content frequently changes. Each upgrade may break your SQL request. Moreover it contains binary data (issue location) which can't be parsed as-is.
The only way to get data is through web services. If api/issues/search faces a limitation that you consider as critical, then you should explain your functional need to the SonarQube google group.

ASP.NET Web API 2 local MySQL code first

I have done simple Web API project using SQL server database with code first approach, see here. But I am not getting any helpful complete tutorial which explains how to create Web API using code first approach with MySQL as database. Could you please give me some sample example.
There isn't much difference since both are relational databases. You need to install the corresponding nuget (Install-Package MySql.Data.Entity), update connection string and you should be good to go
Here is detailed example - http://www.asp.net/identity/overview/getting-started/aspnet-identity-using-mysql-storage-with-an-entityframework-mysql-provider

Wrap SQL Server Objects Quickly?

Back in the MSSQL 2000 timeline, there was an IIS integration layer that allowed HTTP GET commands to make select statements, and there were other SqlXml niceties that worked (not that fast or well but they worked) out of the box. I gave a chance to expose database stuff fairly quickly.
What is the comparable technology for MSSQL 2008/2012? I saw slashDb (http://www.slashdb.com/) and it seems to do that, but I am trying to understand the other options out there. Just SQL Server crud and sproc access.
Thanks.
Yes, SlashDB does exactly that and more. Full disclosure: I am the founder and CEO.
Once SlashDB is installed you would use its web interface to connect it with your database. Depending which database login and database schema you use for that connection, you will have the tables and views from that schema turned into of URL endpoints.
Those URLs can be followed in the browser but they are also API endpoints in JSON, XML or CSV. It works for reading and writing (you can control that in user configuration).
In addition to that you can define a set of parameterized SQL queries. Each query is given a name and instantly becomes an API endpoint too.
In order to help you getting started easily SlashDB is available on AWS and Azure marketplaces, as a Docker container from DockerHub, pre-built virtual machines or as .rpm and .deb packages for installation directly on Linux.
For more technical info please visit: https://docs.slashdb.com
The nearest equivalent may be SOAP/HTTP endpoints, however Microsoft has deprecated them for various reasons and recommends WCF or ASP.NET instead. Although the simplest way to get a quick CRUD setup is probably to use a framework or ORM that generates it for you, like LINQ to SQL or whatever else suits your needs.