Tangram

Json drive data

License

License

MIT
GroupId

GroupId

com.github.mengxianun
ArtifactId

ArtifactId

jdbc
Last Version

Last Version

1.7.3
Release Date

Release Date

Type

Type

jar
Description

Description

Tangram
Json drive data
Project URL

Project URL

https://github.com/aigodata/tangram
Source Code Management

Source Code Management

https://github.com/aigodata/tangram

Download jdbc

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mengxianun/jdbc/ -->
<dependency>
    <groupId>com.github.mengxianun</groupId>
    <artifactId>jdbc</artifactId>
    <version>1.7.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mengxianun/jdbc/
implementation 'com.github.mengxianun:jdbc:1.7.3'
// https://jarcasting.com/artifacts/com.github.mengxianun/jdbc/
implementation ("com.github.mengxianun:jdbc:1.7.3")
'com.github.mengxianun:jdbc:jar:1.7.3'
<dependency org="com.github.mengxianun" name="jdbc" rev="1.7.3">
  <artifact name="jdbc" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mengxianun', module='jdbc', version='1.7.3')
)
libraryDependencies += "com.github.mengxianun" % "jdbc" % "1.7.3"
[com.github.mengxianun/jdbc "1.7.3"]

Dependencies

runtime (8)

Group / Artifact Type Version
com.google.guava : guava jar 28.0-jre
com.google.inject : guice jar 4.2.0
com.google.code.gson : gson jar 2.8.5
org.skyscreamer : jsonassert jar 1.5.0
org.slf4j : slf4j-api jar 1.7.25
com.github.mengxianun : core jar 1.7.3
com.alibaba : druid jar 1.0.15
commons-dbutils : commons-dbutils jar 1.7

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.2.0
com.h2database : h2 jar 1.4.197

Project Modules

There are no modules declared in this project.

Tangram: Json-SQL Api For Datastores

Tangram is a data access framework, providing a SQL-like json interface for operation of different types of datastores.

select

{
  "select": "table",
  "fields": ["column1", "column2", ...],
  "join": ["join_table", ...],
  "where": ["column1=value1", "column2=value2", ...],
  "group": ["column1", "column2", ...],
  "order": ["column1", "column2", ...]
}

insert

{
  "insert": "table",
  "values": {
    "column1": value1,
    "column2": value2,
    ...
  }
}

update

{
  "update": "table",
  "values": {
    "column1": value1,
    "column2": value2,
    ...
  },
  "where": ["column1=value1", "column2=value2", ...]
}

delete

{
  "delete": "table",
  "where": ["column1=value1", "column2=value2", ...]
}

Getting started

Add the library to your project.

Maven

<dependency>
  <groupId>com.github.mengxianun</groupId>
  <artifactId>tangram-jdbc</artifactId>
  <version>x.y.z</version>
</dependency>

Gradle

dependencies {
  implementation 'com.github.mengxianun:tangram-jdbc:x.y.z'
}

Config File

Create a configuration file in the classpath directory and configure the data source. The default configuration file name is air.json

{
    "datasources": {
        "myds": {
            "url": "jdbc:mysql://localhost:3306/tangram",
            "username": "tangram",
            "password": "123456",
            ...
        }
    }
}

Usage

Translator translator = new DefaultTranslator();
String json = "{\"select\":\"sys_user\",\"fields\":\"*\",\"where\":\"id=1\"}";
DataResultSet dataResultSet = translator.translate(json);
Object data = dataResultSet.getData();

Documentation

See the detail documentation or Wiki.

License

This project is licensed under the MIT License.

com.github.mengxianun

aigodata

一支专注可视化与数据分析的团队

Versions

Version
1.7.3
1.7.2