gordb

command module
v0.0.0-...-12e41be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

README

gordb

Circle CI Build Status Coverage Status

Make
go build -ldflags "-X main.version=$(git describe)"
Usage
json
$ curl -X POST localhost:3050/json/dir2 -d '
[
{
	"stream": {
		"union": {
			"inputs": [
			{"iselection": {
							   "input": { "name": "staff" },
								   "attr": "age",  "selector": ">=", "arg": 31
						   }},
			{"iselection": {
							   "input": { "name": "staff" },
							   "attr": "name", "selector": "==", "arg": "山田"
						   }}
			]
		}
	}
},
{
	"stream": {
		"iselection": {
			"input": { "name": "rank" },
			"attr": "rank",  "selector": ">=", "arg": 1
		}
	}
}
]
'

result:

[{"attrs":["name","age","job"],"data":[["田中",34,"デザイナー"]]},{"attrs":["name","rank"],"data":[["清水",78],["田中",46],["佐藤",33]]}]
php serialize
$ curl -X POST localhost:3050/php/dir2 -d '
[
{
	"options": { "kv": true, "map_key": "name" },
		"stream": {
			"union": {
				"inputs": [
				{"iselection": {
								   "input": { "name": "staff" },
								   "attr": "age",  "selector": ">=", "arg": 31
							   }},
				{"iselection": {
								   "input": { "name": "staff" },
								   "attr": "name", "selector": "==", "arg": "山田"
							   }}
				]
			}
		}
},
{
	"options": { "kv": true, "map_key": "name" },
	"stream": {
		"iselection": {
			"input": { "name": "rank" },
			"attr": "rank",  "selector": ">=", "arg": 1
		}
	}
}
]
'

result:

a:2:{i:0;a:3:{s:4:"Name";s:0:"";s:5:"Attrs";a:3:{i:1;s:3:"age";i:2;s:3:"job";i:0;s:4:"name";}s:4:"Data";a:1:{s:6:"田中";a:3:{s:4:"name";s:6:"田中";s:3:"age";i:34;s:3:"job";s:15:"デザイナー";}}}i:1;a:3:{s:4:"Data";a:3:{s:6:"清水";a:2:{s:4:"rank";i:78;s:4:"name";s:6:"清水";}s:6:"田中";a:2:{s:4:"name";s:6:"田中";s:4:"rank";i:46;}s:6:"佐藤";a:2:{s:4:"name";s:6:"佐藤";s:4:"rank";i:33;}}s:4:"Name";s:0:"";s:5:"Attrs";a:2:{i:1;s:4:"rank";i:0;s:4:"name";}}}
Relational database term

https://en.wikipedia.org/wiki/Relational_database#Terminology

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
example
example
go-rdb go-rdb go-rdb go-rdb go-rdb Operator go-rdb go-rdb go-rdb go-rdb Tuple go-rdb go-rdb Value
go-rdb go-rdb go-rdb go-rdb go-rdb Operator go-rdb go-rdb go-rdb go-rdb Tuple go-rdb go-rdb Value
input
csv

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL