Orasql - An autonomous Oracle sql toolbox

Go CodeQL

orasql

An autonomous Oracle sql toolbox

Usage:

Usage:
./orasql  -dsn server_url -query sql
  -csv
    	CSV Output
  -debug
    	Show column type (Default output only)
  -dsn string
    	oracle://user:pass@dsn/service_name
    	Env: ORACLESQL_DSN, ORACLESQL_USER, ORACLESQL_PWD
  -file string
    	Input query from file (default "/dev/stdin")
  -json
    	JSON Output
  -kv
    	Key/Value Output (2 columns max)
  -output string
    	Output file (default "/dev/stdout")
  -payload string
    	Input payload Json from file
  -query string
    	select 'column' as column_name from dual

Example:

   ./orasql  -dsn "oracle://user:pass@server/service_name" -query "select sysdate from dual"
   ./orasql  -dsn "oracle://user:pass@server/service_name" -file query.sql
   ./orasql  -payload payload.json
   echo 'select sysdate from dual' |  ./orasql  -dsn "oracle://user:pass@server/service_name"

With os.env: 
   ORACLESQL_DSN=127.0.0.1:1521/DB ORACLESQL_USER=user ORACLESQL_PWD=password  ./orasql  -query "select sysdate from dual"

default output:
  SYSDATE    : 2022-01-06 18:26:37 +0000 UTC

-debug:
  SYSDATE    [DATE]           : 2022-01-06 19:26:27 +0000 UTC

-json:
  [
    {"SYSDATE": "2022-01-06T18:21:57Z"}
  ]

-csv:
  "SYSDATE"
  "2022-01-06 18:28:03 +0000 UTC"

-kv with ("select 'Date', sysdate from dual"):
  "Date": "2022-01-06T19:21:21Z"

-payload:
With json file:
  {
    "dsn": "127.0.0.1:1521/DB",
    "user": "user",
    "password": "password",
    "query": "select sysdate from dual"
  }
Owner
Database Administrator as a job. Programmer, photography, motorcycle, biking as Hobbies.
null
Similar Resources

Dumpling is a fast, easy-to-use tool written by Go for dumping data from the database(MySQL, TiDB...) to local/cloud(S3, GCP...) in multifarious formats(SQL, CSV...).

🥟 Dumpling Dumpling is a tool and a Go library for creating SQL dump from a MySQL-compatible database. It is intended to replace mysqldump and mydump

Nov 9, 2022

Universal command-line interface for SQL databases

usql A universal command-line interface for PostgreSQL, MySQL, Oracle Database, SQLite3, Microsoft SQL Server, and many other databases including NoSQ

Jan 9, 2023

auto generate sql from gorm model struct

gorm2sql: auto generate sql from gorm model struct A Swiss Army Knife helps you generate sql from gorm model struct. Installation go get github.com/li

Dec 22, 2022

a golang library for sql builder

Gendry gendry is a Go library that helps you operate database. Based on go-sql-driver/mysql, it provides a series of simple but useful tools to prepar

Dec 26, 2022

Fluent SQL generation for golang

Squirrel is "complete". Bug fixes will still be merged (slowly). Bug reports are welcome, but I will not necessarily respond to them. If another fork

Dec 29, 2022

SQL Optimizer And Rewriter

SQL Optimizer And Rewriter

文档 | FAQ | 变更记录 | 路线图 | English SOAR SOAR(SQL Optimizer And Rewriter) 是一个对 SQL 进行优化和改写的自动化工具。 由小米人工智能与云平台的数据库团队开发与维护。 功能特点 跨平台支持(支持 Linux, Mac 环境,Wind

Jan 4, 2023

Additions to Go's database/sql for super fast performance and convenience.

gocraft/dbr (database records) gocraft/dbr provides additions to Go's database/sql for super fast performance and convenience. $ go get -u github.com/

Jan 1, 2023

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022

xsqlparser - SQL 解析

xsqlparser sql parser for golang. This repo is ported of sqlparser-rs in Go. Getting Started Prerequisites Go 1.12+ Installing $ go get -u github.com/

Dec 18, 2022
Implementasi database oracle kedalam golang

Go with Oracle database Implementasi database oracle kedalam golang How to using swagger Install generator swagger menggunakan perintah : go get -u gi

Nov 20, 2021
write APIs using direct SQL queries with no hassle, let's rethink about SQL

SQLer SQL-er is a tiny portable server enables you to write APIs using SQL query to be executed when anyone hits it, also it enables you to define val

Jan 7, 2023
Parses a file and associate SQL queries to a map. Useful for separating SQL from code logic

goyesql This package is based on nleof/goyesql but is not compatible with it any more. This package introduces support for arbitrary tag types and cha

Oct 20, 2021
Go-sql-reader - Go utility to read the externalised sql with predefined tags

go-sql-reader go utility to read the externalised sql with predefined tags Usage

Jan 25, 2022
Go package for sharding databases ( Supports every ORM or raw SQL )
Go package for sharding databases ( Supports every ORM or raw SQL )

Octillery Octillery is a Go package for sharding databases. It can use with every OR Mapping library ( xorm , gorp , gorm , dbr ...) implementing data

Dec 16, 2022
Prep finds all SQL statements in a Go package and instruments db connection with prepared statements

Prep Prep finds all SQL statements in a Go package and instruments db connection with prepared statements. It allows you to benefit from the prepared

Dec 10, 2022
pggen - generate type safe Go methods from Postgres SQL queries

pggen - generate type safe Go methods from Postgres SQL queries pggen is a tool that generates Go code to provide a typesafe wrapper around Postgres q

Jan 3, 2023
🐳 A most popular sql audit platform for mysql
🐳 A most popular sql audit platform for mysql

?? A most popular sql audit platform for mysql

Jan 6, 2023
sqlx is a library which provides a set of extensions on go's standard database/sql library

sqlx is a library which provides a set of extensions on go's standard database/sql library. The sqlx versions of sql.DB, sql.TX, sql.Stmt, et al. all leave the underlying interfaces untouched, so that their interfaces are a superset on the standard ones. This makes it relatively painless to integrate existing codebases using database/sql with sqlx.

Jan 7, 2023
A tool to run queries in defined frequency and expose the count as prometheus metrics. Supports MongoDB and SQL
A tool to run queries in defined frequency and expose the count as prometheus metrics. Supports MongoDB and SQL

query2metric A tool to run db queries in defined frequency and expose the count as prometheus metrics. Why ? Product metrics play an important role in

Jul 1, 2022