Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numberoverzero/basicdatabase
Basic Database
https://github.com/numberoverzero/basicdatabase
Last synced: 17 days ago
JSON representation
Basic Database
- Host: GitHub
- URL: https://github.com/numberoverzero/basicdatabase
- Owner: numberoverzero
- Created: 2012-04-12T01:30:14.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-14T05:54:04.000Z (over 11 years ago)
- Last Synced: 2024-10-07T09:06:52.067Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
To run a session similar to those on
http://www.thumbtack.com/challenges, simply ruin Main.pyNote that this uses a deferred writer, so that responses to
commands are suppressed until you send "END" at which point,
the entire output is written to screen.Example session:
SET a 50
BEGIN
GET a
SET a 60
BEGIN
UNSET a
GET a
ROLLBACK
GET a
COMMIT
GET a
END
50
NULL
60
60Note that there is no prompt symbol (as in the sample input/output),
but one can be specified when creating the DatabaseManager.The following DatabaseManager:
DBM = DatabaseManager.DatabaseManager(GENERIC_DB, '>>> ')produces the following session (same as above)
>>> SET a 50
>>> BEGIN
>>> GET a
50
>>> SET a 60
>>> BEGIN
>>> UNSET a
>>> GET a
NULL
>>> ROLLBACK
>>> GET a
60
>>> COMMIT
>>> GET a
60
>>> END