{"repo":"sionpixley/inquiry","free":true,"listed":false,"github":"https://github.com/sionpixley/inquiry","clone":"git clone https://github.com/sionpixley/inquiry.git","description":"Inquiry is a Go package that converts CSV files into a SQLite database, allowing you to run SQL statements on them.","language":"Go","stars":32,"topics":["csv","go","golang","golang-library","golang-package","sqlite","sqlite3"],"license":"MIT","category":"databases-storage","readme_excerpt":"Inquiry Inquiry is a Go package that converts CSV files into a SQLite database, allowing you to run SQL statements on them. Table of contents 1. How to install 2. How to use 1. Defining your struct 1. Go field to SQLite column mapping 2. Creating an in-memory SQLite database from a CSV file 1. Without options 2. With options 3. Creating a new table from a CSV file and adding it to an existing SQLite database 1. Adding a table to an in-memory database from a CSV 2. Adding a table to an on-disk database from a CSV 3. Contributing How to install go get github.com/sionpixley/inquiry How to use Using Inquiry is pretty simple: You \"connect\" to the CSV file and Inquiry will return a sql.DB and an error . You can then use the returned sql.DB to do any operations that you would normally do with a SQLite database. You can also create new tables from CSV files and add them to an existing SQLite database (in-memory or not). Defining your struct Inquiry uses generics and package reflect to build the SQLite database/table and to insert the data. Please put the struct fields in the same position as the column they are supposed to represent in the CSV file. Different struct definitions yield different SQL CREATE TABLE statements. For example: Please consult the table below for a full list of which Go field types map to which SQLite column types. Go field to SQLite column mapping Go Field Type SQLite Column Type ------------- --------------- bool INTEGER NOT NULL CHECK( IN (0,1)) bool INTEGER","default_branch":null,"files":null,"tree":[],"storefront":"/r/sionpixley","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sionpixley/inquiry/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}