diff options
author | sanine-a <sanine.not@pm.me> | 2023-05-02 14:47:02 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2023-05-02 14:47:02 -0500 |
commit | 9ab2e0044c8976b5669a069e61479354ca52980c (patch) | |
tree | a62f31483c0ee055fe83376f71971e01ddc02320 /db/endpoint.go | |
parent | ad6a617c12d9b341be1357dcbb6ab58febe32ee8 (diff) |
add endpoint.go
Diffstat (limited to 'db/endpoint.go')
-rw-r--r-- | db/endpoint.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/endpoint.go b/db/endpoint.go index cb59de5..d880510 100644 --- a/db/endpoint.go +++ b/db/endpoint.go @@ -2,7 +2,7 @@ package db func (p *Phlox) CreateEndpoint(name, path, address string) (Endpoint, error) { var id int - row := p.db.QueryRow("select max(endpointid) from endpoints;") + row := p.db.QueryRow("select coalesce(max(endpointid), 0) from endpoints;") err := row.Scan(&id) if err != nil { return Endpoint{}, err |