mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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] (Bitbake rev: f5ba7775cfcb90401522d977cc66fe0f5aeb7a66) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7afa726bec
commit
549eccc0db
@@ -94,7 +94,7 @@ class SQLTable(collections.MutableMapping):
|
|||||||
self.table = table
|
self.table = table
|
||||||
self.connection = connect(self.cachefile)
|
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.retry
|
||||||
@_Decorators.transaction
|
@_Decorators.transaction
|
||||||
|
|||||||
Reference in New Issue
Block a user