JsonSQL4J

Generate SQL queries from JSON strings

Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

io.github.eaxdev
Идентификатор

Идентификатор

jsonsql4j
Последняя версия

Последняя версия

0.0.3
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

JsonSQL4J
Generate SQL queries from JSON strings
Ссылка на сайт

Ссылка на сайт

https://github.com/eaxdev/JsonSQL4J
Организация-разработчик

Организация-разработчик

com.github.eaxdev
Система контроля версий

Система контроля версий

https://github.com/eaxdev/JsonSQL4J

Скачать jsonsql4j

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-databind jar 2.10.1

runtime (1)

Идентификатор библиотеки Тип Версия
org.projectlombok : lombok jar 1.18.10

Модули Проекта

Данный проект не имеет модулей.

JsonSQL4J

Build Status GitHub license Maven Central codecov Quality Gate Status

This library for mapping JSON style query objects to SQL queries

Get it!

Maven

You can use following Maven dependency:

<dependency>
  <groupId>io.github.eaxdev</groupId>
  <artifactId>jsonsql4j</artifactId>
  <version>0.0.2</version>
</dependency>

Gradle

implementation 'io.github.eaxdev:jsonsql4j:0.0.2'

Also, you can use GitHub Packages.

Use it!

Given JSON:

{
  "fields": [
    {"column": "field1"},
    {"column": "field2", "alias": "test"}
  ],
  "from": [
    {"table": "table1", "schema": "schema"}
  ],
  "where": {
    "or": [
      { "eq": {"fieldName": "field3", "value": "5"} },
      { "eq": {"fieldName": "field4", "value": "3"} }
    ]
  }
}

use library:

Query selectQuery = new SelectQuery(jsonString);
String query = selectQuery.getQuery();
// query = SELECT field1, field2 AS test FROM schema.table1 WHERE (field3 = 5 OR field4 = 3)

You can find more examples here.

License

JsonSQL4J is open-source project, and distributed under the MIT license

Версии библиотеки

Версия
0.0.3
0.0.2
0.0.1