Git Product home page Git Product logo

db2csv's Introduction

Export table from database to csv file

Export table from database to csv file.

Supported Databases
  • SQlite
  • MySQL
  • PosgreSQL
Install (For Linux and OS X)

sh install.sh

Usage

At first, you must fill in the "db2csv.ini". The INI file includes application and database settings. You can find a detailed explanation below. If INI file is in the working directory and named "db2scv.ini", you can run the binary directly.

./bin/db2scv-darwin-amd64

If not, you must say where it is by "-conf" parameter.

./db2scv-darwin-amd64 -conf ~/batur/settings/my-dv2csv-1.ini

Setting INI File
[app]

Sql = "select * from attack_result  where vector = 1"
Filename = "result"
FilesPath = ./files
OverwriteFile = false
#false: Adds date suffix to the filename

[database]

Type = "sqlite3"
#Types: sqlite3, mysql, postgres

# Sqlite Settings

SqliteFile = "/Users/batur/go/db/demo_picus_db"

# Postgres setting

#User = postgres
#Password = postgres
#Host = localhost
#DbName = test
#Port = 5432
#SslMode = disable

# Mysql setting

#User = root
#Password = root
#Host = localhost
#DbName = test
#Port = 3306

[app]

  • Sql : Raw SQL command
  • Filename : CSV Filename
  • FilesPath : Where csv files will save
  • OverwriteFile : True > Always overwrite same file, False > Adds date suffix to the filename, there will be a different file saved every run.

[database]

  • Type : Database type (Values: sqlite3, mysql, postgres)

The other parameters change depend on the database type. You should check example above.

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.