[oe-commits] [bitbake] 02/07: persist_data: Add key constraints

git at git.openembedded.org git at git.openembedded.org
Fri Dec 7 12:43:19 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

commit f5ba7775cfcb90401522d977cc66fe0f5aeb7a66
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Mon Dec 3 21:42:31 2018 -0600

    persist_data: Add key constraints
    
    Constructs the "key" column in the persistent database as a non-NULL
    primary key. This significantly speeds up lookup operations in large
    databases.
    
    [YOCTO #13030]
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/persist_data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index 1a6319f..2bc3e76 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -94,7 +94,7 @@ class SQLTable(collections.MutableMapping):
         self.table = table
         self.connection = connect(self.cachefile)
 
-        self._execute_single("CREATE TABLE IF NOT EXISTS %s(key TEXT, value TEXT);" % table)
+        self._execute_single("CREATE TABLE IF NOT EXISTS %s(key TEXT PRIMARY KEY NOT NULL, value TEXT);" % table)
 
     @_Decorators.retry
     @_Decorators.transaction

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list