Skip to content

Repository files navigation

SQL IMUX

Go Reference Pipes

SQL IMUX runs the same query across multiple servers and combines the results.

Table of Contents

  1. Installation
  2. Usage
  3. Supported Databases

Installation

go install github.com/samlitowitz/sqlimux/cmd/sqlimux@latest

Usage

 sqlimux sql-file-to-execute.sql --targets targets.json

Example output on standard out with includeTargetID enabled.

targetID,integer_col
sqlite2,
sqlite2,1
sqlite1,
sqlite1,1
postgres,
postgres,2
mysql,
mysql,4

Configuration

The targets file follows the JSON Schema defined in assets/schema/targets.json.

Here is an example.

{
  "includeTargetID": true,
  "targets": [
    {
      "targetID": "postgres",
      "type": "postgres",
      "dsn": "postgres://user:password@127.0.0.1:5432/user"
    },
    {
      "targetID": "mysql",
      "type": "mysql",
      "dsn": "user:password@tcp(127.0.0.1:3306)/public?multiStatements=true"
    },
    {
      "targetID": "sqlite1",
      "type": "sqlite",
      "dsn": "file:test_1.db"
    },
    {
      "targetID": "sqlite2",
      "type": "sqlite",
      "dsn": "file:test_2.db"
    }
  ]
}

Supported Databases

The following databases are currently supported

  • MySQL
  • Postgres
  • SQLite

About

SQL IMUX runs the same query across multiple servers and combines the results

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages