Permalink
Browse files

add few TODO and billets for sqlite implementation

  • Loading branch information...
ownport committed Sep 7, 2012
1 parent cd8d344 commit 8a87e1393a5acc66e53a5aa894ee3feefb736fc4
Showing with 13 additions and 1 deletion.
  1. +13 −1 kvlite.py
View
@@ -2,13 +2,15 @@
# -*- coding: utf-8 -*-
#
# Simple key-value datastore
+
# - support only mysql database
# - console support added
#
# some ideas taked from PyMongo interface http://api.mongodb.org/python/current/index.html
# kvlite2 tutorial http://code.google.com/p/kvlite/wiki/kvlite2
#
# TODO autocommit for put()
+# TODO synchronise documents between few datastores
#
#
__author__ = 'Andrey Usov <http://devel.ownport.net>'
@@ -48,6 +50,8 @@
print >> sys.stderr, 'Error! MySQLdb package is not installed, please install python-mysqldb'
sys.exit()
+# TODO add deferent serialization on user choice (pickle & json)
+# TODO add support user specific serializators
from json import loads as json_decode
from json import dumps as json_encode
@@ -138,8 +142,15 @@ def delete_collection(URI):
conn.commit()
# -----------------------------------------------------------------
-# Collection class
+# Collections class
# -----------------------------------------------------------------
+
+class MysqlConnection(object):
+ pass
+
+class SqliteCollection(object):
+ pass
+
class Collection(object):
'''
kvlite2 collection
@@ -163,6 +174,7 @@ def __init__(self, db_uri):
def get_uuid(self):
""" return id based on uuid """
+ # TODO add generation UUID in case of use sqlite database
if not self.__uuids:
self.__cursor.execute('SELECT %s;' % ','.join(['uuid()' for _ in range(100)]))
for uuid in self.__cursor.fetchone():

0 comments on commit 8a87e13

Please sign in to comment.