mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-04 15:40:36 +08:00

* chore: changed lib * chore: changed lib * chore: changed lib * chore: changed lib * chore: changes in params * chore: changes in params * chore: moving telemetry to a separate package * feat: enabling telemetry via env var * chore: removing posthog api_key * feat: send heartbeat every 6hr * feat: enabled version in application * feat: added getter and setter apis and struct for user preferences * feat: added version to properties to event * feat: added apis to set and get user preferences and get version * chore: refactored get and set userPreferences apis to dao pattern * chore: added checks for telemetry enabled and anonymous during initialization * chore: changed anonymous user functionality * chore: sanitization * chore: added uuid for userPreferences to send when user is anonymous
27 lines
526 B
Go
27 lines
526 B
Go
package dao
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.signoz.io/query-service/constants"
|
|
"go.signoz.io/query-service/dao/interfaces"
|
|
"go.signoz.io/query-service/dao/sqlite"
|
|
)
|
|
|
|
func FactoryDao(engine string) (*interfaces.ModelDao, error) {
|
|
var i interfaces.ModelDao
|
|
var err error
|
|
|
|
switch engine {
|
|
case "sqlite":
|
|
i, err = sqlite.InitDB(constants.RELATIONAL_DATASOURCE_PATH)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
default:
|
|
return nil, fmt.Errorf("RelationalDB type: %s is not supported in query service", engine)
|
|
}
|
|
|
|
return &i, nil
|
|
}
|