Get data from .csv files use SQL-like queries.

csvql

Get data from .csv files use SQL-like queries.

Задание

Необходимо написать консольную программу, которая по заданному клиентом запросу осуществляет поиск данных в CSV-файлах, своего рода простенький исполнитель SQL запросов. При запуске программа должна предлагать пользователю ввести через командную строку поисковой запрос, сформированный в виде набора условий:

column_name OP value [AND/OR column_name OP value] …

Например, age > 40 AND status = “sick”

Критерии приемки

  • При запуске программа печатает путь до исполняемого файла и версию последнего коммита
  • Программа должна корректно обрабатывать выход по сигналу SIGINT, прерывая поиск, если он запущен
  • Программа должна получать настройки из текстового конфигурационного файла (например, в TOML формате) при старте
  • Программа должна завершать исполнение запроса, если он занимает слишком продолжительное время (значение таймаута задается в конфигурационном файле)
  • Программа должна логировать все запросы в файл access.log, логировать все ошибки (например, остановку пользователем или прерывания по таймауту, невалидные запросы пользователя) в error.log
  • Код должен быть покрыт тестами (test coverage хотя бы 30%)
  • Код должен быть организован согласно выбранным принципам, например можно использовать project-layout для вдохновения
  • Должен быть создан конфигурационный файл для golangci-lint
  • При коммите в локальный репозиторий в автоматическом режиме должно происходить следующее make test - должен запускать тесты и печатать отчет о coverage make check - должен запускать все линтеры

Дополнительные задания (не обязательные к выполнению):

  • Задавать через конфигурационный файл индекс по одному из полей таблицы, строить B-tree или Hash индекс по этому полю при старте программы
  • Поддержать синтаксис выбора отдельных полей из таблиц в запросе, например как SELECT first_name, last_name FROM my.csv WHERE age > 40 AND status = “sick”
Similar Resources

A tool to run queries in defined frequency and expose the count as prometheus metrics. Supports MongoDB and SQL

A tool to run queries in defined frequency and expose the count as prometheus metrics. Supports MongoDB and SQL

query2metric A tool to run db queries in defined frequency and expose the count as prometheus metrics. Why ? Product metrics play an important role in

Jul 1, 2022

sqlbench measures and compares the execution time of one or more SQL queries.

sqlbench sqlbench measures and compares the execution time of one or more SQL queries. The main use case is benchmarking simple CPU-bound query varian

Dec 6, 2022

SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call.

SQL API SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call. The request contains the DB credenti

Dec 2, 2022

A database connection wrapper to cache prepared statements by transforming queries to use with array arguments.

sqlpp sqlpp is a sql(MySQL and PostgreSQL) database connection wrapper to cache prepared statements by transforming queries ("...in (?)...", []) to us

Feb 9, 2022

Go library that stores data in Redis with SQL-like schema

Go library that stores data in Redis with SQL-like schema. The goal of this library is we can store data in Redis with table form.

Mar 14, 2022

Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.

Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.

Terraform Plugin for Steampipe Use SQL to query data from Terraform configuration files. Get started → Documentation: Table definitions & examples Com

Dec 22, 2022

This is the code example how to use SQL to query data from any relational databases in Go programming language.

Go with SQL example This is the code example how to use SQL to query data from any relational databases in Go programming language. To start, please m

Mar 12, 2022

Go package providing simple database and server interfaces for the CSV files produced by the sfomuseum/go-libraryofcongress package

Go package providing simple database and server interfaces for the CSV files produced by the sfomuseum/go-libraryofcongress package

go-libraryofcongress-database Go package providing simple database and server interfaces for the CSV files produced by the sfomuseum/go-libraryofcongr

Oct 29, 2021

Go-sql-reader - Go utility to read the externalised sql with predefined tags

go-sql-reader go utility to read the externalised sql with predefined tags Usage

Jan 25, 2022
Related tags
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.

trdsql CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. It is a tool like q, textql and others. The difference from these tools is t

Jan 1, 2023
Run SQL queries against JSON, CSV, Excel, Parquet, and more.

Run SQL queries against JSON, CSV, Excel, Parquet, and more This is a CLI companion to DataStation (a GUI) for running SQL queries against data files.

Dec 31, 2022
Opionated sql formatter for use with .go files containing backticked queries

fumpt-the-sql Opionated sql formatter for use with .go files containing backticked queries. Uses https://sqlformat.darold.net/ for the actual sql form

Dec 10, 2021
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...).

?? Dumpling Dumpling is a tool and a Go library for creating SQL dump from a MySQL-compatible database. It is intended to replace mysqldump and mydump

Nov 9, 2022
write APIs using direct SQL queries with no hassle, let's rethink about SQL

SQLer SQL-er is a tiny portable server enables you to write APIs using SQL query to be executed when anyone hits it, also it enables you to define val

Jan 7, 2023
Parses a file and associate SQL queries to a map. Useful for separating SQL from code logic

goyesql This package is based on nleof/goyesql but is not compatible with it any more. This package introduces support for arbitrary tag types and cha

Oct 20, 2021
Querycrate - A simple library that loads and keeps SQL queries from files

QueryCrate A simple library for loading & getting string queries from files. How

Feb 15, 2022
Mergestat - a command-line tool for running SQL queries on git repositories and related data sources
Mergestat - a command-line tool for running SQL queries on git repositories and related data sources

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. ?? ??

Dec 30, 2022
Lightweight SQL database written in Go for prototyping and playing with text (CSV, JSON) data

gopicosql Lightweight SQL database written in Go for prototyping and playing wit

Jul 27, 2022
pggen - generate type safe Go methods from Postgres SQL queries

pggen - generate type safe Go methods from Postgres SQL queries pggen is a tool that generates Go code to provide a typesafe wrapper around Postgres q

Jan 3, 2023