GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - badoo/kexasol: Exasol database driver implemented in Kotlin (JVM). It is based on native WebSocket API, supports parallel CSV streaming and compression.

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
examples
examples
 
 
gradle/wrapper
gradle/wrapper
 
 
kexasol
kexasol
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
build.gradle.kts
build.gradle.kts
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Build Status Release

KExasol is a custom database driver for Exasol implemented in Kotlin (JVM).

It offers unique features compared to standard JDBC driver:

  • based on native WebSocket API;
  • takes advantage of modern I/O libraries: Okio, OkHttp, Moshi;
  • efficient data transport via CSV streaming;
  • read and write data in parallel processes with linear scaling;
  • network traffic compression;
  • rich SQL query formatting with named and typed placeholders;

KExasol encourages best practices that are specific for Exasol distributed architecture and massively parallel data processing. It will help you to fully leverage capabilities of this analytical DBMS.

Quick links

  • Getting started
  • Reference
  • Examples
  • Data types
  • Best practices
  • SQL formatting
  • Changelog

System requirements

  • Exasol >= 6.0
  • Kotlin >= 1.4
  • Java >= 8

Getting started

Add JitPack Maven repository to build.gradle.kts:

repositories {
    ...
    maven { setUrl("https://jitpack.io") }
}

Add dependency:

implementation("com.github.badoo:kexasol:0.2.1")

Run basic query:

val exa = ExaConnectionOptions(dsn = "<host:port>", user = "sys", password = "exasol").connect()

exa.use {
    val st = exa.execute("SELECT user_name, created FROM exa_all_users LIMIT 5")

    st.forEach { row ->
        println(row)
    }
}

Read data via CSV streaming:

val exa = ExaConnectionOptions(dsn = "<host:port>", user = "sys", password = "exasol").connect()

exa.use {
    exa.streamExportReader("EXA_ALL_USERS", columns = listOf("USER_NAME", "CREATED")) { reader ->
        reader.forEach { row ->
            println(row.getString("USER_NAME"))
            println(row.getLocalDateTime("CREATED"))
        }
    }
}

Create a new table and import some data in transaction:

val exa = ExaConnectionOptions(dsn = "<host:port>", user = "sys", password = "exasol").connect()

val cols = listOf("USER_ID", "USER_NAME", "IS_ACTIVE")

val data = listOf<List<Any?>>(
    listOf(1L, "Alice", true),
    listOf(2L, "Bob", false),
    listOf(3L, "Cindy", null),
)

exa.use {
    exa.setAutocommit(false)

    exa.execute("CREATE SCHEMA IF NOT EXISTS kexasol_test")

    exa.execute("""
        CREATE OR REPLACE TABLE test_table
        (
            user_id       DECIMAL(9,0),
            user_name     VARCHAR(255),
            is_active     BOOLEAN
        )
    """)

    val importSt = exa.streamImportIterator("test_table", cols, data.iterator())
    println("IMPORT affected rows: ${importSt.rowCount}")

    exa.commit()
}

Check other examples and best practices.

Created by

Vitaly Markov, 2020

Enjoy!

License

Copyright 2020 Badoo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Exasol database driver implemented in Kotlin (JVM). It is based on native WebSocket API, supports parallel CSV streaming and compression.

Topics

database-connectorexasolexasol-dbkotlin-librarywebsocket-client

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

12 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.