Skip to content

A command line tool to dump SQL data using T-SQL query

License

Notifications You must be signed in to change notification settings

alexhokl/sql-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL export CLI Build Status

A command line tool to dump SQL data using T-SQL query

Usage: sql-export [command]

Available Commands

Command Description
screen Dump data from database and print it on screen
gsheets Dump data from database and upload onto Google Sheets

Use "sql-export [command] --help" for more information about a command.

Example: sql-export gsheets -c config.yml

Sample configuration

config.yml
database_type: mssql
database:
  server: example.com
  port: 1433
  name: Northwind
  username: sa
  password: pass
google_client_secret_file_path: ~/Downloads/client-secret.json
document_name: Google.DocumentExport.Example
sheets:
  - name: users
    query: "SELECT TOP 10 * FROM Users"
    columns:
      - index: 5
        data_type: date
        format: dd-MM-yyyy

Installation

go install github.com/alexhokl/sql-export@latest

Development

Please visit Google API console to create an application and enable Google Drive API. From section Credentials in APIs and services, download credentials file and save it. Configure the path to this file as google_client_secret_file_path.

About

A command line tool to dump SQL data using T-SQL query

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published