You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

com.github.mengxianun:tangram-result-csv

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.mengxianun:tangram-result-csv

Json drive data


Version published
Maintainers
1

Readme

Source

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.

FAQs

Package last updated on 04 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc