Go-get-it - Simple database query script for UNIX-terminal usage

go-get-it

Simple database query script for UNIX-terminal usage

  • Supports MongoDB

Quick start

Commands:

Usage of ggi:
  -c string
    	MongoDB collection name : string (default "none")
  -f string
    	MongoDB find json-filter : string (default "none")
  -i int
    	MongoDB document '_id' field : int64
  -is string
    	MongoDB document '_id' field : string (default "none")
  -l int
    	Limit for find command : int64

Usage examples:

~/$ ggi -c myCollectionWithIntId -i 10001 | jq
{
  "_id": 10001
}

~/$ ggi -c myCollection -is desiredId | jq
{
  "_id": "desiredId"
}

~/$ ggi -c myCollection -f '{}' | jq
[
 {
   "_id": "desiredId"
 },
 {
   "_id": "otherId"
 }
]

~/$ ggi -c myCollection -f '{}' -l 1 | jq
[
 {
   "_id": "desiredId"
 }
]

How to run script

  1. Create config file $HOME/.ggi/config.json

Example,

{
  "host" : "host",
  "port" : 27017,
  "database" : "database",
  "username" : "username",
  "password" : "password",
  "caFile" : "/usr/local/share/ca-certificates/my-cert/CAs.pem"
} 

Here caFile is optional, may be used for TLS communication

  1. go build ~/cmd/ggi/ggi.go && ./ggi or go run ~/cmd/ggi/ggi.go
Owner
Andrew Aleynikov
Software Engineer at Yandex
Andrew Aleynikov
Similar Resources

Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Deploy, Manage and Query Cloud Infrastructure using SQL [Documentation] [Developer Guide] Cloud infrastructure coding using SQL InfraQL allows you to

Oct 25, 2022

Query redis with SQL

Query redis with SQL

reqlite reqlite makes it possible to query data in Redis with SQL. Queries are executed client-side with SQLite (not on the redis server). This projec

Dec 23, 2022

Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.

Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.

VirusTotal Plugin for Steampipe Use SQL to query file, domain, URL and IP scanning results from VirusTotal. Get started → Documentation: Table definit

Nov 10, 2022

Use SQL to instantly query users, groups, applications and more from Okta. Open source CLI. No DB required.

Use SQL to instantly query users, groups, applications and more from Okta. Open source CLI. No DB required.

Okta Plugin for Steampipe Use SQL to query infrastructure including users, groups, applications and more from Okta. Get started → Documentation: Table

Nov 10, 2022

Go sqlite3 http vfs: query sqlite databases over http with range headers

sqlite3vfshttp: a Go sqlite VFS for querying databases over http(s) sqlite3vfshttp is a sqlite3 VFS for querying remote databases over http(s). This a

Dec 27, 2022

Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Scaleway Plugin for Steampipe Use SQL to query infrastructure servers, networks, databases and more from your Scaleway project. Get started → Document

Nov 16, 2022

Use SQL to instantly query Datadog resources across accounts. Open source CLI. No DB required.

steampipe-plugin-datadog Datadog Plugin for Steampipe Use SQL to query dashboards, users, roles and more from Datadog. Get started → Documentation: Ta

Dec 17, 2022

Use SQL to query information including Users, Groups, Clients, Roles and more from Keycloak.

Keycloak Plugin for Steampipe [WIP] THIS IS NOT ACTIVE NOR WORKING YET - DO NOT USE Use SQL to query information including Users, Groups, Clients, Rol

Jan 6, 2023

Use SQL to query instances, domains and more from Prometheus.

Use SQL to query instances, domains and more from Prometheus.

Use SQL to instantly query Prometheus metrics, alerts, labels and more. Open source CLI. No DB required.

Nov 28, 2022
A MySQL-compatible relational database with a storage agnostic query engine. Implemented in pure Go.

go-mysql-server go-mysql-server is a SQL engine which parses standard SQL (based on MySQL syntax) and executes queries on data sources of your choice.

Jan 2, 2023
Minimal memory usage, cloud native logstash alternative
Minimal memory usage, cloud native logstash alternative

Mr-Plow Tiny and minimal tool to export data from relational db (postgres or mysql) to elasticsearch. The tool does not implement all the logstash fea

Aug 18, 2022
Interactive terminal user interface and CLI for database connections. MySQL, PostgreSQL. More to come.
Interactive terminal user interface and CLI for database connections. MySQL, PostgreSQL. More to come.

?? dbui dbui is the terminal user interface and CLI for database connections. It provides features like, Connect to multiple data sources and instance

Jan 5, 2023
[mirror] the database client and tools for the Go vulnerability database

The Go Vulnerability Database golang.org/x/vulndb This repository is a prototype of the Go Vulnerability Database. Read the Draft Design. Neither the

Dec 29, 2022
Database - Example project of database realization using drivers and models

database Golang based database realization Description Example project of databa

Feb 10, 2022
Simple pgx wrapper to execute and scan query results

pig Simple pgx wrapper to execute and scan query results. Features All-in-one tool; Simple transactions management: You can set idle_in_transaction_se

Dec 5, 2022
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022
A Go SQL query builder and struct mapper.

godb - a Go query builder and struct mapper godb is a simple Go query builder and struct mapper, not a full-featured ORM. godb does not manage relatio

Dec 6, 2022
Use SQL to query host, DNS and exploit information using Shodan. Open source CLI. No DB required.

Shodan Plugin for Steampipe Query Shodan with SQL Use SQL to query host, DNS and exploit information using Shodan. For example: select * from shod

Nov 10, 2022