table all field

This commit is contained in:
2025-10-18 14:43:42 +05:30
parent 325103e8ef
commit 12d6fface6
16 changed files with 149 additions and 137 deletions

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package branchuser
import "code.patial.tech/go/pgm"
const (
// All fields in table branch_users
All pgm.Field = "branch_users.*"
// BranchID field has db type "bigint NOT NULL"
BranchID pgm.Field = "branch_users.branch_id"
// UserID field has db type "bigint NOT NULL"

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package comment
import "code.patial.tech/go/pgm"
const (
// All fields in table comments
All pgm.Field = "comments.*"
// ID field has db type "integer NOT NULL"
ID pgm.Field = "comments.id"
// PostID field has db type "integer NOT NULL"

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package employee
import "code.patial.tech/go/pgm"
const (
// All fields in table employees
All pgm.Field = "employees.*"
// ID field has db type "integer NOT NULL"
ID pgm.Field = "employees.id"
// Name field has db type "var NOT NULL"

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package post
import "code.patial.tech/go/pgm"
const (
// All fields in table posts
All pgm.Field = "posts.*"
// ID field has db type "integer NOT NULL"
ID pgm.Field = "posts.id"
// UserID field has db type "integer NOT NULL"

View File

@@ -1,5 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd
// DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package db

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package user
import "code.patial.tech/go/pgm"
const (
// All fields in table users
All pgm.Field = "users.*"
// ID field has db type "integer NOT NULL"
ID pgm.Field = "users.id"
// Name field has db type "character varying(255) NOT NULL"

View File

@@ -1,10 +1,12 @@
// Code generated by db-gen. DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
package usersession
import "code.patial.tech/go/pgm"
const (
// All fields in table user_sessions
All pgm.Field = "user_sessions.*"
// ID field has db type "character varying NOT NULL"
ID pgm.Field = "user_sessions.id"
// CreatedAt field has db type "timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL"

View File

@@ -10,7 +10,7 @@ import (
func TestDelete(t *testing.T) {
expected := "DELETE FROM users WHERE users.id = $1 AND users.status_id != ANY($2)"
got := db.User.Delete().
Where(user.ID.Eq(1), user.StatusID.NotIn(1, 2, 3)).
Where(user.ID.Eq(1), user.StatusID.NotAny(1, 2, 3)).
String()
if got != expected {
t.Errorf("got %q, want %q", got, expected)

View File

@@ -36,7 +36,7 @@ func TestInsertQuery2(t *testing.T) {
}
}
// BenchmarkInsertQuery-12 1952412 605.3 ns/op 1144 B/op 18 allocs/op
// BenchmarkInsertQuery-12 2014519 584.0 ns/op 1144 B/op 18 allocs/op
func BenchmarkInsertQuery(b *testing.B) {
for b.Loop() {
_ = db.User.Insert().
@@ -51,7 +51,6 @@ func BenchmarkInsertQuery(b *testing.B) {
}
// BenchmarkInsertSetMap-12 1534039 777.1 ns/op 1480 B/op 20 allocs/op
// BenchmarkInsertSetMap-12 1361275 879.2 ns/op 1480 B/op 20 allocs/op
func BenchmarkInsertSetMap(b *testing.B) {
for b.Loop() {
_ = db.User.Insert().

View File

@@ -27,7 +27,6 @@ func TestUpdateQuery(t *testing.T) {
}
// BenchmarkUpdateQuery-12 2004985 592.2 ns/op 1176 B/op 20 allocs/op
// BenchmarkUpdateQuery-12 1792483 670.7 ns/op 1176 B/op 20 allocs/op
func BenchmarkUpdateQuery(b *testing.B) {
for b.Loop() {
_ = db.User.Update().