[oe-commits] [bitbake] 02/07: bitbake: persist_data: Add key constraints
git at git.openembedded.org
git at git.openembedded.org
Wed Dec 5 13:39:10 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 3858480d83525d010d87b574ff9388aef7aa5c33
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Mon Dec 3 21:42:31 2018 -0600
bitbake: 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