(ctx *sql.Context, subscription string)
| 129 | } |
| 130 | |
| 131 | func SelectSubscriptionLsn(ctx *sql.Context, subscription string) (pglogrepl.LSN, error) { |
| 132 | var lsn string |
| 133 | if err := adapter.QueryRowCatalog(ctx, catalog.InternalTables.PgSubscription.SelectColumnsStmt(lsnValueColumns), subscription).Scan(&lsn); err != nil { |
| 134 | if errors.Is(err, stdsql.ErrNoRows) { |
| 135 | // if the LSN doesn't exist, consider this a cold start and return 0 |
| 136 | return pglogrepl.LSN(0), nil |
| 137 | } |
| 138 | return 0, err |
| 139 | } |
| 140 | |
| 141 | return pglogrepl.ParseLSN(lsn) |
| 142 | } |
no test coverage detected