MCPcopy Create free account
hub / github.com/featureform/featureform / NewSQLOfflineStore

Function NewSQLOfflineStore

provider/sql.go:80–96  ·  view source on GitHub ↗

NewPostgresOfflineStore creates a connection to a postgres database and initializes a table to track currently active Resource tables.

(config SQLOfflineStoreConfig)

Source from the content-addressed store, hash-verified

78// NewPostgresOfflineStore creates a connection to a postgres database
79// and initializes a table to track currently active Resource tables.
80func NewSQLOfflineStore(config SQLOfflineStoreConfig) (*sqlOfflineStore, error) {
81 url := config.ConnectionURL
82 db, err := sql.Open(config.Driver, url)
83 if err != nil {
84 return nil, NewProviderError(Connection, config.ProviderType, ClientInitialization, err.Error())
85 }
86
87 return &sqlOfflineStore{
88 db: db,
89 parent: config,
90 query: config.QueryImpl,
91 BaseProvider: BaseProvider{
92 ProviderType: config.ProviderType,
93 ProviderConfig: config.Config,
94 },
95 }, nil
96}
97
98func checkName(id ResourceID) error {
99 if strings.Contains(id.Name, "__") || strings.Contains(id.Variant, "__") {

Callers 4

mySqlOfflineStoreFactoryFunction · 0.85

Calls 2

NewProviderErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected