Giter Site home page Giter Site logo

bjoernkw / zenquery Goto Github PK

View Code? Open in Web Editor NEW
63.0 7.0 15.0 5.98 MB

Enterprise backend as a service

Home Page: https://www.zenqry.com/

License: Apache License 2.0

Shell 0.11% Java 73.16% PLSQL 9.66% HTML 17.07%
database-connection sql-query java jdbc data-processing api-generator rest-api rest automatic-api

zenquery's Introduction

ZenQuery

Table of Contents

Introduction - Enterprise Backend as a Service

Requirements

Getting started

Using ZenQuery

Features

UI

Support

ZenQuery allows you to easily access databases through a REST API.

All you have to do is enter your database connection settings and ZenQuery will generate REST API endpoints for all your database tables and views. Moreover, you can easily add custom SQL queries for access via REST API calls.

ZenQuery provides SQL result sets as JSON, XML, HTML or CSV data.

ZenQuery is an Enterprise Backend as a Service along lines of Parse but for your own databases. It's like Heroku Dataclips but for non-cloud, on-premises databases.

ZenQuery is a JavaEE application that's securely hosted on your servers. No data ever leaves your company!

ZenQuery has the following minimum requirements:

  • Java 6
  • a Servlet container or application server (stand-alone option available)
  • a database server (embedded H2 database available)

Installation

ZenQuery can be built and installed as a standard web application archive (WAR). Any JavaEE 7 or JavaEE 6 servlet container should work.

In order to start and run properly two settings need to be configured for ZenQuery:

  • the database to store the application data in
  • security preferences

Database

If you're using a dedicated database for ZenQuery (as you probably should for production) you first need to run a DDL script that creates the necessary tables. DDL scripts for the following databases are included in src/main/resources/sql in the ZenQuery directory:

  • H2
  • MySQL
  • Oracle Database
  • PostgreSQL

Then you need to set the system property DATABASE_URL according to your database connection settings.

How you set this system property depends on your environment. A common way for doing so is using the -D command line option for Java, e.g.:

java -DDATABASE_URL=postgres://username:password@localhost:5432/ZenQuery ...

The format for the URL is

PROTOCOL://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME

A PostgreSQL DATABASE_URL for example would look like this:

DATABASE_URL=postgres://username:password@localhost:5432/ZenQuery

The following protocols / RDBMS are available. Please note that only H2, MySQL and PostgreSQL drivers are included with ZenQuery. If you want to use one of the other RDBMS you have to add the appropriate JDBC driver to the shared libraries directory of your Servlet container / application server:

  • as400 (IBM DB2 AS400)
  • db2 (IBM DB2)
  • derby (Apache Derby)
  • edbc (Ingres Database)
  • firebirdsql (Firebird)
  • h2 (H2)
  • hsqldb (HSQLDB)
  • mysql (MySQL)
  • oracle (Oracle Database)
  • postgres (PostgreSQL)
  • sapdb (SAP DB)
  • sqlserver (Microsoft SQL Server)
  • sybase (Sybase)

Please note: Only H2, MySQL and PostgreSQL drivers are included with ZenQuery. If you want to use one of the other RDBMS you have to add the appropriate JDBC driver to the shared libraries directory of your Servlet container / application server.

Security

In order to set your basic security preferences for ZenQuery the environment variable spring.profiles.active has to be set to either 'local' or 'public', i.e.:

spring.profiles.active=local

or

spring.profiles.active=public

'local' will disable HTTP basic authentication whereas 'public' will enable it. The default password is 'pP2XLieKb6'. This password can (and should be) changed in spring-security-public.xml in src/main/webapp in the ZenQuery directory. Please restart the server after having changed the password. Please note: If you turn HTTP basic authentication on your API calls will have to send an HTTP basic authentication header with the appropriate username / password, too.

How you set the spring.profiles.active system property depends on your environment. A common way for doing so is using the -D command line option for Java, e.g.:

java -Dspring.profiles.active=local ...

Using ZenQuery is simple. ZenQuery has 2 main views:

Here you can add and edit and your database connections. A valid database connection consists of:

  • name
  • URL
  • username
  • password

The URL has to be a valid JDBC connection URL such as:

jdbc:postgresql://localhost:5432/SomeDatabase

The following JDBC connection protocols / RDBMS are supported:

  • jdbc:as400:// (IBM DB2 AS400)
  • jdbc:db2:// (IBM DB2)
  • jdbc:derby: (Apache Derby)
  • jdbc:ingres:// (Ingres Database)
  • jdbc:firebirdsql:// (Firebird)
  • jdbc:h2: (H2)
  • jdbc:hsqldb:mem: (HSQLDB)
  • jdbc:JTurbo:// (Microsoft SQL Server, JTurbo driver)
  • jdbc:mysql:// (MySQL)
  • jdbc:oracle:thin:@ (Oracle Database)
  • jdbc:postgresql:// (PostgreSQL)
  • jdbc:sapdb:// (SAP DB)
  • jdbc:microsoft:sqlserver (Microsoft SQL Server)
  • jdbc:sybase:Tds: (Sybase)

Please note: Only H2, MySQL and PostgreSQL drivers are included with ZenQuery. If you want to use one of the other RDBMS you have to add the appropriate JDBC driver to the shared libraries directory of your Servlet container / application server.

After having entered a valid database connection ZenQuery will automatically create SELECT * FROM queries for each table and view in your database. If your database uses foreign keys ZenQuery will extend those queries to include links to referenced database entity resources.

Clicking on the 'Queries' button from the top menu will show all queries. Clicking the respective button for each database connection will show only the queries for that connection.

Clicking on 'Details' for a query will preview the result set for this query as well as reveal a few additional options:

  • Execute
  • Update
  • New
  • Previous versions

Alongside these options ZenQuery displays REST API links for this query above and below the result set preview.

ZenQuery allows you to use the ? operator for dynamically supplying one or multiple arguments to a query, e.g.:

SELECT * FROM table WHERE field = ?
SELECT * FROM table WHERE field = ? OR another_field = ?

These arguments can then be supplied as additional URL parameters to your API calls.

If your database tables make use of foreign keys for referencing entities ZenQuery will automatically link those to the referencing entity and add a link to the API resource for the referenced entity.

ZenQuery turns each SQL query into an easily accessible REST API endpoint that returns data in a variety of formats.

The ZenQuery REST API returns data in the following formats:

  • JSON
  • XML
  • HTML
  • CSV

These are a few example URLs:

ZenQuery also allows you to add arguments to an API call, which will be used for interpolating variables in the SQL query. The arguments are appended to the URL after the query ID. Multiple arguments are comma-separated. Moreover, you can also limit the size of the result set by adding a size parameter.

Again, these are a few example URLs:

  • Generate REST APIs from SQL queries.
  • Access your data in JSON, XML or CSV formats.
  • Supports all major RDBMS (including IBM DB2, Microsoft SQL Server, MySQL, Oracle Database and PostgreSQL).
  • Entirely hosted on-premises. Your data stays with you all the time!
  • Conveniently edit your SQL queries and preview your data.
  • Version control for SQL queries.
  • Snapshots (i.e. materialized views if supported by RDBMS).
  • Transitive navigation (i.e. navigating entities referenced by foreign keys).
  • Variable interpolation.
  • Limit and filter query results.

The ZenQuery UI source code is available here.

If you have any questions, suggestions, problems or feature requests please contact us under [email protected]

Please also visit our website for further information.

zenquery's People

Contributors

bjoernkw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zenquery's Issues

Implement automatic keyword extraction for query results

Extract keywords from text fields in query results and display those in the HTML view for SEO purposes.

These keywords could possibly also be linked to content creation providers. This would allow customers to have additional content created for their database content automatically.

Add repository topic "automatic-api"

Could you add the topic automatic-api to your repository? Software that automatically exposes APIs to databases isn't well-cataloged. (There didn't even seem to be a list on GitHub, so I started one recently.) It will be easier to discover if there is a standard GitHub topic, and automatic-api seems as good a candidate as any. Nine projects already use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.