Coder Social home page Coder Social logo

sqlread's Introduction

sqlread

Go Report Card GoDoc Build Status Build Status

sqlread is a mysql dump parser that allows you to query MySQL dumps directly without loading them into MySQL, and export specific tables from said dumps.

Currently very picky and only likes mysqldump generated output dumps. Mileage may vary on dumps created with other tools such as Navicat. Compatibility is a work in progress.

Todo:

While the code is quite usable and useful, I still have a ways to go.

  • Query fields without backticks - currently all fields must be wrapped in backticks.
  • General Expression Support
    • Basic WHERE support
    • Basic ORDER BY support
  • Optimization of heavily \'d string parsing

Installation

From Source

go install github.com/donatj/sqlread/cmd/sqlread@latest

Precompiled Binaries

Available on the Releases page currently for Linux and macOS.

Example usage

$ sqlread buildings.sql
2017/12/22 12:23:52 starting initial pass
2017/12/22 12:23:52 loaded from cache
2017/12/22 12:23:52 finished initial pass
> SHOW TABLES;
buildings
2017/12/22 12:24:01 restarting lexer

> SHOW COLUMNS FROM `buildings`;
building_id,int
account_id,int
title,varchar
descr,varchar
city,varchar
state_id,smallint
zip_code,varchar
deleted,tinyint
2017/12/22 12:24:08 restarting lexer

> SELECT `building_id`, `title` FROM `buildings`;
2,Home Building
190,Test Building (demo)
192,Donat Building
194,Other Building
201,Sample Building (demo)
205,Johnson Building
2017/12/22 12:24:44 restarting lexer

> SELECT `building_id`, `title` FROM `buildings` INTO OUTFILE "dump.csv";
2017/12/22 12:27:43 written to `dump.csv`
2017/12/22 12:27:43 restarting lexer

sqlread's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar donatj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sqlread's Issues

Fails to install from source

$ go get -u -v github.com/donatj/hookah/cmd/sqlread
github.com/donatj/hookah (download)
package github.com/donatj/hookah/cmd/sqlread: cannot find package "github.com/donatj/hookah/cmd/sqlread" in any of:
	/usr/local/Cellar/go/1.12.7/libexec/src/github.com/donatj/hookah/cmd/sqlread (from $GOROOT)
	$HOME/go/src/github.com/donatj/hookah/cmd/sqlread (from $GOPATH)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.