All Projects → mithrandie → Csvq

mithrandie / Csvq

Licence: other
SQL-like query language for csv

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Csvq

Q
q - Run SQL directly on CSV or TSV files
Stars: ✭ 8,809 (+995.65%)
Mutual labels:  command-line-tool, csv, sql
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-87.31%)
Mutual labels:  command-line-tool, csv
Sqlparser
Simple SQL parser meant for querying CSV files
Stars: ✭ 249 (-69.03%)
Mutual labels:  csv, sql
Rainbow csv
🌈Rainbow CSV - Vim plugin: Highlight columns in CSV and TSV files and run queries in SQL-like language
Stars: ✭ 337 (-58.08%)
Mutual labels:  csv, sql
Octosql
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Stars: ✭ 2,579 (+220.77%)
Mutual labels:  csv, sql
Algeria Cities
The list of all Algerian provinces and cities according to the official division in different formats: csv, xlsx, php, json, etc.
Stars: ✭ 232 (-71.14%)
Mutual labels:  csv, sql
Sq
swiss-army knife for data
Stars: ✭ 275 (-65.8%)
Mutual labels:  csv, sql
Rbql
🦜RBQL - Rainbow Query Language: SQL-like language for (not only) CSV file processing. Supports SQL queries with Python and JavaScript expressions
Stars: ✭ 118 (-85.32%)
Mutual labels:  csv, sql
Datasette
An open source multi-tool for exploring and publishing data
Stars: ✭ 5,640 (+601.49%)
Mutual labels:  csv, sql
Trdsql
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.
Stars: ✭ 593 (-26.24%)
Mutual labels:  csv, sql
World countries
Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP and SQL formats, in multiple languages and with national flags included
Stars: ✭ 598 (-25.62%)
Mutual labels:  csv, sql
Bancosbrasileiros
Lista de bancos brasileiros | Brazilian banks list
Stars: ✭ 178 (-77.86%)
Mutual labels:  csv, sql
Neo4j Etl
Data import from relational databases to Neo4j.
Stars: ✭ 165 (-79.48%)
Mutual labels:  csv, sql
Dumpling
Dumpling is a fast, easy-to-use tool written by Go for dumping data from the database(MySQL, TiDB...) to local/cloud(S3, GCP...) in multifarious formats(SQL, CSV...).
Stars: ✭ 134 (-83.33%)
Mutual labels:  csv, sql
Countries
Countries, Languages & Continents data (capital and currency, native name, calling codes).
Stars: ✭ 656 (-18.41%)
Mutual labels:  csv, sql
Sqawk
Like Awk but with SQL and table joins
Stars: ✭ 263 (-67.29%)
Mutual labels:  csv, sql
Countries States Cities Database
🌍 World countries, states, regions, provinces, cities, towns in JSON, SQL, XML, PLIST, YAML, and CSV. All Countries, States, Cities with ISO2, ISO3, Country Code, Phone Code, Capital, Native Language, Timezones, Latitude, Longitude, Region, Subregion, Flag Emoji, and Currency. #countries #states #cities
Stars: ✭ 1,130 (+40.55%)
Mutual labels:  csv, sql
Tableqa
AI Tool for querying natural language on tabular data.
Stars: ✭ 109 (-86.44%)
Mutual labels:  csv, sql
Finviz
Unofficial API for finviz.com
Stars: ✭ 493 (-38.68%)
Mutual labels:  csv, sql
Municipios Brasileiros
🏡 Código IBGE, nome do município, capital, código UF, UF, estado, latitude e longitude das cidades brasileiras
Stars: ✭ 638 (-20.65%)
Mutual labels:  csv, sql

csvq

SQL-like query language for csv

Build Status codecov

csvq is a command line tool to operate CSV files. You can read, update, delete CSV records with SQL-like query.

You can also execute multiple operations sequentially in managed transactions by passing a procedure or using the interactive shell. In the multiple operations, you can use variables, cursors, temporary tables, and other features.

Features

  • CSV File Operation

    • Select Query
    • Insert Query
    • Update Query
    • Replace Query
    • Delete Query
    • Create Table Query
    • Alter Table Query
  • Cursor

  • Temporary Table

  • Transaction Management

  • Support loading data from Standard Input

  • Support following file formats

    • CSV
    • TSV
    • LTSV
    • Fixed-Length Format
    • JSON
  • Support following file encodings

    • UTF-8
    • UTF-16
    • Shift_JIS

    JSON Format supports only UTF-8.

Reference Manual

Reference Manual - csvq

Installation

Install executable binary

  1. Download an archive file from release page.
  2. Extract the downloaded archive and add a binary file in it to your path.

Build from source

Requirements

Go 1.14 or later (ref. Getting Started - The Go Programming Language)

Build command

$ env GO111MODULE=on go get github.com/mithrandie/csvq

Install using package manager

Installing using a package manager does not ensure that you always get the latest version, but it may make installation and updating easier.

Ubuntu

  1. $ sudo add-apt-repository ppa:mithrandie/csvq
  2. $ sudo apt update
  3. $ sudo apt install csvq

macOS (unofficial)

  1. Install homebrew (ref. The missing package manager for macOS (or Linux) — Homebrew)
  2. $ brew install csvq

Usage

# Simple query
csvq 'select id, name from `user.csv`'
csvq 'select id, name from user'

# Specify data delimiter as tab character
csvq -d '\t' 'select count(*) from `user.csv`'

# Load no-header-csv
csvq --no-header 'select c1, c2 from user'

# Load from redirection or pipe
csvq 'select * from stdin' < user.csv
cat user.csv | csvq 'select *'

# Load from Fixed-Length Format
cat /var/log/syslog | csvq -n -i fixed -m '[15, 24, 124]' 'select *'

# Split lines with spaces automatically
ps | csvq -i fixed -m spaces 'select * from stdin'

# Output in JSON format
csvq -f json 'select integer(id) as id, name from user'

# Output to a file
csvq -o new_user.csv 'select id, name from user'

# Load statements from file
$ cat statements.sql
VAR @id := 0;
SELECT @id := @id + 1 AS id,
       name
  FROM user;

$ csvq -s statements.sql

# Execute statements in the interactive shell
$ csvq
csvq > UPDATE users SET name = 'Mildred' WHERE id = 2;
1 record updated on "/home/mithrandie/docs/csv/users.csv".
csvq > COMMIT;
Commit: file "/home/mithrandie/docs/csv/users.csv" is updated.
csvq > EXIT;

# Show help
csvq -h

More details >> https://mithrandie.github.io/csvq

Execute csvq statements in Go

csvq-driver

Example of cooperation with other applications

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].