From f0ee4ba310f7034f549570a0833ac7ba41e9ab7f Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Mar 2024 20:03:50 -0400 Subject: Add adapter tests --- internal/storage/adapter.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/storage/adapter.go') diff --git a/internal/storage/adapter.go b/internal/storage/adapter.go index ce01989..d4573f0 100644 --- a/internal/storage/adapter.go +++ b/internal/storage/adapter.go @@ -3,8 +3,16 @@ package storage import "github.com/eugenetriguba/bolt/internal/configloader" type DBAdapter interface { + // ConvertGenericPlaceholders replaces any generic `?` placeholders + // in `query` for the database driver specific placeholders and returns + // the updated query. ConvertGenericPlaceholders(query string, argsCount int) string + // TableExists checks if the tableName exists within the + // database currently connected to. TableExists(executor sqlExecutor, tableName string) (bool, error) + // DatabaseName retrieves the currently selected database name. DatabaseName(executor sqlExecutor) (string, error) + // CreateDSN creates a DSN to be used with sql.Open in the database + // driver specific format. CreateDSN(cfg configloader.ConnectionConfig) string } -- cgit v1.2.3