aboutsummaryrefslogtreecommitdiffstats
path: root/internal/storage/adapter.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/storage/adapter.go')
-rw-r--r--internal/storage/adapter.go8
1 files changed, 8 insertions, 0 deletions
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
}