Skip to content

Commit

Permalink
Review DB related section
Browse files Browse the repository at this point in the history
  • Loading branch information
ugurdogrusoz committed Dec 30, 2019
1 parent 867e80e commit 0507d38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/DG.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ Also, their display names should be added to [the Query tab component file](../s

As explained in the [User Guide](UG.md), this tab is used to change all types of settings in your application. The content of this tab is automatically generated and is *not* meant to be customizable.

## using different databases
To use a different database, you should change [db-adapter.service.ts file](../src/app/db-service/db-adapter.service.ts). In the ideal case, only changing the constructor of the service should be enough. Just by injecting your own [angular service](https://angular.io/tutorial/toh-pt4) which implements [the interface DbService](../src/app/db-service/data-types.ts), you can switch to another database. But queries are application-specific and you might to change/delete them or implement new queries for your application.
## Using A Different Database

For each database, database dependent query codes should be inside only one file. This file is the angular service that you should generate as your database driver. For example, Visu*all* uses neo4j database. All the queries which are specific for neo4j are inside the file named [neo4j-db.service.ts file](../src/app/db-service/neo4j-db.service.ts). Neo4j uses a language called [cypher](https://neo4j.com/developer/cypher-query-language/) for querying the database.
To use a different database in the back end, you should modify [the db-adapter.service.ts file](../src/app/db-service/db-adapter.service.ts). Idealy, only changing the constructor of the service should be sufficient. Just by injecting [your own angular service](https://angular.io/tutorial/toh-pt4) which implements [the interface DbService](../src/app/db-service/data-types.ts), you can switch to another database. Of course for your application-specific queries, you will want to change/delete existing ones or implement new ones.

Most of the database queries are built by parsing filtering rules or they are hardcoded queries. For parsing rules, you can check the implementation of the function called `rule2cql` inside the file [neo4j-db.service.ts](../src/app/db-service/neo4j-db.service.ts). Since the queries are application-specific, they might be different or might not even exist.
For each database, database dependent query code should be inside only one file. This file is the angular service that you should generate as your database driver. For example, Visu*all* uses Neo4j database. All the queries which are specific to Neo4j are inside the file named [neo4j-db.service.ts](../src/app/db-service/neo4j-db.service.ts). Neo4j uses a query language called [Cypher](https://neo4j.com/developer/cypher-query-language/) for querying the database.

Some database queries are generated by parsing filtering rules while others are hardcoded. For parsing rules, you can check the implementation of the function called `rule2cql` inside the file [neo4j-db.service.ts](../src/app/db-service/neo4j-db.service.ts). Since the queries are application-specific, they will look different or might not even exist.

0 comments on commit 0507d38

Please sign in to comment.