graph/db: add a framework for testing against SQL backends incrementally

In this commit, we implement the postgres and sqlite versions of the
NewTestDB function. We add the various build flags so that only one of
the three versions of this function can be active at a time.

We also introduce the SQLStore struct which is the SQL implementation of
the V1Store interface.

NOTE: it currently temporarily embeds the KVStore struct so that we can
implement the V1Store interface incrementally. For any method not
implemented, things will fall back to the KVStore. This is ONLY the
case for the time being while this struct is purely used in unit tests
only. Once all the methods have been implemented, the KVStore field will
be removed from the SQLStore struct.
This commit is contained in:
Elle Mouton
2025-04-05 19:24:48 +02:00
parent 383453635b
commit b4121acb1f
5 changed files with 126 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
//go:build !test_db_sqlite && !test_db_postgres
package graphdb
import (