diff options
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 |