Tangram

Json drive data

License

License

MIT
GroupId

GroupId

com.github.mengxianun
ArtifactId

ArtifactId

tangram-result
Last Version

Last Version

1.4.8
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 tangram-result

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.commons : commons-math3 jar 3.6.1

runtime (5)

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

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.2.0
junit : junit jar 4.12

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.4.8
1.4.7
1.4.6
1.4.4.2
1.4.4.1
1.4.4
1.4.3
1.4.2
1.4.0.1
1.4.0
1.3.9.2
1.3.9.1
1.3.9
1.2.8
1.2.7
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.0.1
1.0.0