Simple in-memory database written in Go.
Get/Set concurrency locks aren't there yet.
Golang compiler and tools (v1.5 or later) are required. See the official Getting Started guide or your distro's docs for detailed instructions.
go get -u github.com/utrack/go-simple-memdb
If you're using Go < 1.6 - you need to set envvar GO15VENDOREXPERIMENT to 1 before go-getting:
GO15VENDOREXPERIMENT=1 go get -u github.com/utrack/go-simple-memdb
Check that your PATH envvar has $GOPATH\bin and run the command:
go-simple-memdb
SET <name <value>– Sets the variablenameto the valuevalue. Variable name should not contain spaces.GET <name>– Value of the variablenameis returned.NULLis returned if that variable was not set before.UNSET <name>– Unsets the variable name, making it just like that variable was never set.NUMEQUALTO <value>– Number of variables that are currently set to value is returned.END– Exit the program.
This storage supports nested transactions.
BEGIN– Open a new transaction block. Transaction blocks can be nested; aBEGINcan be issued inside of an existing block.ROLLBACK– Most recent transaction block is closed, all changes in it are forgotten.NO TRANSACTIONis printed if there's no transactions in progress.COMMIT– Closes all open transaction blocks, permanently applying the changes made in them.NO TRANSACTIONis printed if there's no transactions in progress.
Any data command that is run outside of a transaction block is committed immediately.
go test github.com/utrack/go-simple-memdb/...
Tests are using the GoConvey framework. If you have goconvey tools installed in your $PATH, run goconvey github.com/utrack/go-simple-memdb/... to use its web interface.