Skip to content
/ xray Public

About Xray: Simplify database structure extraction for MySQL, PostgreSQL, BigQuery, Redshift, MsSQL and Snowflake in Go

Notifications You must be signed in to change notification settings

yindia/xray

Repository files navigation

XRay

XRay is an open-source Go library and CLI tool for database schema extraction and query execution. It supports multiple databases and provides a unified interface for developers and data engineers.


Features

  • Extracts schema metadata from popular databases.
  • Executes SQL queries across different engines.
  • Unified API for multiple backends.
  • Easy integration into Go projects.
  • CLI for quick inspection and automation.

Installation

Library

go get github.com/yindia/xray@latest

CLI

MacOS

brew install yindia/homebrew-tap/xray

Linux

curl -sL https://raw.githubusercontent.com/yindia/xray/main/install.sh | sudo bash -s -- -b /usr/local/bin

Quick Start

Go Library Example

package main

import (
    "github.com/yindia/xray"
    "github.com/yindia/xray/config"
)

func main() {
    cfg := config.Config{
        // Fill in your database config here
    }
    client, err := xray.NewClient(cfg)
    if err != nil {
        panic(err)
    }

    schema, err := client.ExtractSchema()
    if err != nil {
        panic(err)
    }

    // Use schema metadata
    fmt.Println(schema)
}

See example/{database}/main.go for full working examples for each supported database.


Supported Databases

  • MySQL
  • PostgreSQL
  • Redshift
  • BigQuery
  • Snowflake
  • MSSQL

Integration Guides

Example Projects


CLI Usage

See CLI Getting Started for full documentation.


Documentation


Contributing

Contributions are welcome! Please open issues or pull requests.


License

MIT


Show Your Support

If you find XRay useful, please consider starring the repository on GitHub!

About

About Xray: Simplify database structure extraction for MySQL, PostgreSQL, BigQuery, Redshift, MsSQL and Snowflake in Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published