Skip to content

Commit 4aa9c37

Browse files
committed
[-] fix cannot scan NULL into *string, closes #725
1 parent 06f39e5 commit 4aa9c37

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/pgengine/access.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,15 @@ FROM timetable.chain WHERE (client_name = $1 OR client_name IS NULL) AND chain_i
131131

132132
// GetChainElements returns all elements for a given chain
133133
func (pge *PgEngine) GetChainElements(ctx context.Context, chainTasks *[]ChainTask, chainID int) error {
134-
const sqlSelectChainTasks = `SELECT task_id, command, kind, run_as, ignore_error, autonomous, database_connection, timeout
134+
const sqlSelectChainTasks = `SELECT
135+
task_id,
136+
command,
137+
kind,
138+
COALESCE(run_as, '') as run_as,
139+
ignore_error,
140+
autonomous,
141+
COALESCE(database_connection, '') as database_connection,
142+
timeout
135143
FROM timetable.task WHERE chain_id = $1 ORDER BY task_order ASC`
136144
rows, err := pge.ConfigDb.Query(ctx, sqlSelectChainTasks, chainID)
137145
if err != nil {

0 commit comments

Comments
 (0)