diff --git a/api/datastore/postgres/postgres.go b/api/datastore/postgres/postgres.go index 4c0f48aa0..de37206b2 100644 --- a/api/datastore/postgres/postgres.go +++ b/api/datastore/postgres/postgres.go @@ -205,10 +205,6 @@ func scanApp(scanner rowScanner, app *models.App) error { &configStr, ) - if configStr == "" { - return models.ErrAppsNotFound - } - json.Unmarshal([]byte(configStr), &app.Config) return err @@ -536,7 +532,7 @@ func (ds *PostgresDatastore) Put(ctx context.Context, key, value []byte) error { VALUES ($1, $2) ON CONFLICT (key) DO UPDATE SET value = $1; - `, value) + `, string(key), string(value)) if err != nil { return err @@ -548,7 +544,7 @@ func (ds *PostgresDatastore) Put(ctx context.Context, key, value []byte) error { func (ds *PostgresDatastore) Get(ctx context.Context, key []byte) ([]byte, error) { row := ds.db.QueryRow("SELECT value FROM extras WHERE key=$1", key) - var value []byte + var value string err := row.Scan(&value) if err == sql.ErrNoRows { return nil, nil @@ -556,5 +552,5 @@ func (ds *PostgresDatastore) Get(ctx context.Context, key []byte) ([]byte, error return nil, err } - return value, nil + return []byte(value), nil }