geocoding added, but working so-so, need to fix some lines

This commit is contained in:
2026-03-26 21:37:52 +05:00
parent 2718c8ddb2
commit ea0d710428
8 changed files with 287 additions and 33 deletions

View File

@@ -85,15 +85,11 @@ func GetOne[T any](ctx context.Context, db Querier, table string, opts ...func(*
func Create[T any](ctx context.Context, table string, item T, db Querier, opts ...func(*sqlbuilder.SelectBuilder)) error {
structs := sqlbuilder.NewStruct(new(T))
slog.Info("Items", slog.Any("Item", item))
sb := structs.WithoutTag("db", "-").InsertInto(table, item)
sb.SetFlavor(sqlbuilder.PostgreSQL)
query, args := sb.Build()
slog.Info("Query", slog.String("query", query), slog.Any("args", args))
if _, err := db.Exec(ctx, query, args...); err != nil {
slog.ErrorContext(ctx, "cannot create item",
slog.String("query", query),