Code Monkey home page Code Monkey logo

procedures-api's Introduction

Spring Boot SQL over HTTP service

This is Spring Boot service that allows to call SQL commands against multiple data sources over HTTP.

Features:

  1. Multiple data-sources inside a single running application.
  2. Dynamic HTTP url and body based on Spring Application properties.

How to use

  1. Setup properties using the samples from tests
  2. Build an HTTP request using the samples

How does it work

The url pattern is: /procedures/{datasource}/{procedureName}
Where:

  • datasource - a value from the operations.dataSource keys of application properties
  • procedureName - a value from operations.procedures keys of application properties

The request body is JSON and each field will be mapped by the JSON field name with operations.procedures.your-procedure.parameters[keys] For example:

#property

lastName:
  key: last_name
  type: VARCHAR

Requires in the body:

{
  "lastName": "The Great"
}

The value of JSON field will be used as SQL named query parameters:

insert into cat (last_name) values (:last_name)

How to build

./gradlew clean build

How to run locally

Terminal:

./gradlew bootRun --args='--spring.profiles.active=dev'

Or use Intellij Idea Run configurations from the run directory for Idea 2019.3+

Used Gradle tasks

  • javadoc - generate Spring Boot Configuration properties metadata to the build directory

Todo

  1. Would be interesting to see SQL execution check mechanism, i.e. put something to the properties and check it after the execution.
  2. Spring Cloud Config Server and Spring Cloud eureka configurable integration
  3. Documentation on application properties
  4. Logging of database queries
  5. Kubernetes setup
  6. integration test sourceSet refactor
  7. Write test for multiple database: blocked by the issue with same bean names in auto configurations datasourceDependencyPostProcessor

procedures-api's People

Contributors

artemptushkin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.