{"id":43776730,"url":"https://github.com/rasteric/minidb","last_synced_at":"2026-02-05T17:31:47.640Z","repository":{"id":57492974,"uuid":"158399205","full_name":"rasteric/minidb","owner":"rasteric","description":"A minimalist DB wrapper for Golang and a key-value database command line tool","archived":false,"fork":false,"pushed_at":"2021-11-26T20:39:22.000Z","size":42251,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T00:41:48.238Z","etag":null,"topics":["database","key-value-database","sqlite3"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rasteric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-20T14:06:57.000Z","updated_at":"2022-02-06T09:43:25.000Z","dependencies_parsed_at":"2022-08-28T11:51:11.879Z","dependency_job_id":null,"html_url":"https://github.com/rasteric/minidb","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/rasteric/minidb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasteric%2Fminidb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasteric%2Fminidb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasteric%2Fminidb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasteric%2Fminidb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rasteric","download_url":"https://codeload.github.com/rasteric/minidb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasteric%2Fminidb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29127041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T17:12:17.649Z","status":"ssl_error","status_checked_at":"2026-02-05T17:11:23.670Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","key-value-database","sqlite3"],"created_at":"2026-02-05T17:31:46.559Z","updated_at":"2026-02-05T17:31:47.625Z","avatar_url":"https://github.com/rasteric.png","language":"Go","readme":" # Minidb\n*-- a minimalist database for Golang and a key-value database command line tool*\n\n[![GoDoc](https://godoc.org/github.com/rasteric/minidb/go?status.svg)](https://godoc.org/github.com/rasteric/minidb)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rasteric/minidb)](https://goreportcard.com/report/github.com/rasteric/minidb)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nMinidb is an early version of an SQL database wrapper library and a command line database written in Go. It currently allows you to create tables with \"fields\", where each field may contain a string, int, blob, or date. It also has types string-list, int-list, blob-list, and date-list. Tables and their fields can then be queried by the command line tool _minidb_. Use the --help command line option for more information about the CLI tool.\n\nThe database uses an existing SQL driver and wraps around it. The command line tool uses Sqlite3 and the library is also only tested with Sqlite. I try to avoid using Sqlite-specific constructs but currently do not guarantee that it will work with other SQL databases.\n\n## The Library\n\nYou can use `go get github.com/rasteric/minidb` to import the library. The library for Go has two APIs. The direct API provides functions for manipulating the database, most of which work on the basis of an MDB structure. This structure stores the driver and is obtained via the `Open` function. The direct API functions are pretty straightforward wrapper to the underlying SQL database. Although there are many internal error checks, you ought never manipulate the underlying database directly, though.\n\nThe indirect API uses `Command` and `Result` structures that provide an additional abstraction layer on top of the direct API. These structures can be marshalled and unmarshalled to JSON, which allows them to be used in client/server architectures. A function `Exec` executes a `Command` and returns a `Result`. For convenience, functions are provided that return commands and take a numerical database id instead of a pointer to MDB as the first argument, but otherwise mirror the direct API exactly. For example, the counterpart to `(db *MDB) GetFields(table string) ([]Field, error)` is `GetFieldsCommand(db CommandDB, table string) *Command`.\n\nThe command line tool in the `cmd` directory uses the indirect API to implement inter-process communication between the command line tool `cmd/minidb/minidb` and the local server in `cmd/mdbserve/mdbserve`.\n\nPublic functions in the source code are commented unless they are easy to read.\n\n## The Command Line Tool\n\nThe command line tool is in `cmd/minidb/minidb` and uses a relative path to the server executable by default. Use the `--help` option to get information about its usage. One important thing that is not documented yet, because it's not fully finished, is the find query syntax. It works like this: You can only search within one table at a time and combine field queries with boolean operators `and`, `or`, and `not`. List fields allow additional prefix-operators `every` and `no`. The actual query format is `fieldname=like-clause`.\n\n### Examples:\n\n`minidb table Person string-list Name string ZIP int Age Email string`\n\ncreates a table Person with a Name field that can store a list of strings, a ZIP field that stores a string, an Age field that stores an integer, and an Email field that stores a string.\n\n`minidb new Person`\n\nreturns a numeric id for a new Person. \n\n`minidb set Person 1 Name John Caesar Smith Jr`\n\nsets the name of Person 1 to the list of strings \"John\", \"Caesar\", \"Smith\", \"Jr\" (since the shell splits up the strings in this way).\n\n`minidb find Person Name=%John%`\n\nlook for every person whose name contains the string \"John\".\n\n`minidb find Person every Name=%r% and ZIP=111%`\n\nlook for every Person whose name is such that every name string contains the letter \"r\" and whose ZIP string starts with \"111\". This assumes that Person Name is a string-list.\n\n`minidb find Person no Name=John`\n\nassuming that Person Name is of type string-list, this query matches all Persons for which no Name list entry is \"John\".\n\n`minidb find Person Name=John or Name=Smith%`\n\nfind every Person whose Name is exactly \"John\" (in one of its Name fields, if it is a string-list) or whose name starts with \"Smith\" (in one of its Name entries, if it is a string-list).\n\n`minidb set-str 1 \"Hello world!\"`\n\nsets the string with numeric key 1 to \"Hello world!\"\n\n`minidb get-str 1`\n\nreturns \"Hello world!\" + newline if the previous command has been executed before.\n\nIn the key-value interface all keys are integers.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasteric%2Fminidb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasteric%2Fminidb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasteric%2Fminidb/lists"}