You've already forked crud_generator
							
							
				mirror of
				https://github.com/ManyakRus/crud_generator.git
				synced 2025-10-31 00:17:48 +02:00 
			
		
		
		
	сделал postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME)
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -1 +1 @@ | ||||
| 2025-09-12 09:34:57.066 | ||||
| 2025-09-16 10:31:06.531 | ||||
| @@ -1 +1 @@ | ||||
| 00144 | ||||
| 00145 | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"github.com/hashicorp/golang-lru/v2/expirable" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| @@ -36,7 +37,7 @@ func (crud Crud_DB) ReadFromCache(ID int64) (lawsuit_status_types.LawsuitStatusT | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	Otvet, err = ReadFromCache_ctx(ctx, db, ID) | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/micro" | ||||
| 	"github.com/ManyakRus/starter/postgres_gorm" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"gorm.io/gorm" | ||||
| @@ -23,7 +24,7 @@ func (crud Crud_DB) UpdateManyFields(m *lawsuit_status_types.LawsuitStatusType, | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_gorm.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = UpdateManyFields_ctx(ctx, db, m, MassNeedUpdateFields) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,7 +7,7 @@ func (crud Crud_DB) FindBy_FieldNamesWithUnderline(m *lawsuit_status_types.Lawsu | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = FindBy_FieldNamesWithUnderline_ctx(ctx, db, m) | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ func (crud Crud_DB) FindMassBy_FieldNamesWithUnderline(m *lawsuit_status_types.L | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	Otvet, err = FindMassBy_FieldNamesWithUnderline_ctx(ctx, db, m) | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ func (crud Crud_DB) FindModelBy_FieldName(m *lawsuit_status_types.LawsuitStatusT | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	Otvet, err := FindModelBy_FieldName_ctx(ctx, db, m) | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -24,7 +25,7 @@ func (crud Crud_DB) Create(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Create_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -25,7 +26,7 @@ func (crud Crud_DB) Delete(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Delete_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -20,7 +21,7 @@ func (crud Crud_DB) Find_ByExtID(m *lawsuit_status_types.LawsuitStatusType) erro | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = Find_ByExtID_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -27,7 +28,7 @@ func (crud Crud_DB) Read(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = Read_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -27,7 +28,7 @@ func (crud Crud_DB) Delete(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Delete_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -27,7 +28,7 @@ func (crud Crud_DB) Restore(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Restore_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -9,6 +9,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/crud_func" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"strconv" | ||||
| @@ -29,7 +30,7 @@ func (crud Crud_DB) Update(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Update_ctx(ctx, db, m) | ||||
| 	return err | ||||
| @@ -147,7 +148,7 @@ func (crud Crud_DB) Save(m *lawsuit_status_types.LawsuitStatusType) error { | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err := Save_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import ( | ||||
| 	"github.com/ManyakRus/starter/postgres_pgx" | ||||
| 	"github.com/ManyakRus/starter/postgres_pgxpool" | ||||
| 	"github.com/ManyakRus/starter/stopapp" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" | ||||
| 	"sync/atomic" | ||||
| @@ -23,7 +24,7 @@ func (crud Crud_DB) UpdateManyFields(m *lawsuit_status_types.LawsuitStatusType, | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = UpdateManyFields_ctx(ctx, db, m, MassNeedUpdateFields) | ||||
| 	return err | ||||
|   | ||||
| @@ -7,7 +7,7 @@ func (crud Crud_DB) Update_ReplaceFieldName(m *lawsuit_status_types.LawsuitStatu | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	err = Update_ReplaceFieldName_ctx(ctx, db, m) | ||||
| 	return err | ||||
|   | ||||
| @@ -8,7 +8,7 @@ func (crud Crud_DB) ReadAll() ([]lawsuit_status_types.LawsuitStatusType, error) | ||||
| 	ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(db_constants.TIMEOUT_DB_SECONDS)) | ||||
| 	defer ctxCancelFunc() | ||||
|  | ||||
| 	db := postgres_pgxpool.GetConnection() | ||||
| 	db := postgres_pgxpool.GetConnection_NoNull(constants.SERVICE_NAME) | ||||
|  | ||||
| 	Otvet, err = ReadAll_ctx(ctx, db) | ||||
|  | ||||
|   | ||||
| @@ -51,6 +51,9 @@ func CreateFiles_Cache(Table1 *types.Table) error { | ||||
| 		ModelTableURL := create_files.Find_ModelTableURL(TableName) | ||||
| 		TextCache = create_files.AddImport(TextCache, ModelTableURL) | ||||
|  | ||||
| 		ConstantsURL := create_files.Find_ConstantsURL() | ||||
| 		TextCache = create_files.AddImport(TextCache, ConstantsURL) | ||||
|  | ||||
| 		//TextCache = create_files.Convert_RequestIdToAlias(TextCache, Table1) | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -79,6 +79,9 @@ func CreateFiles_UpdateEveryColumn(Table1 *types.Table) error { | ||||
| 		ModelTableURL := create_files.Find_ModelTableURL(TableName) | ||||
| 		TextCrud = create_files.AddImport(TextCrud, ModelTableURL) | ||||
|  | ||||
| 		ConstantsURL := create_files.Find_ConstantsURL() | ||||
| 		TextCrud = create_files.AddImport(TextCrud, ConstantsURL) | ||||
|  | ||||
| 		//TextCrud = create_files.CheckAndAdd_ImportGorm_FromText(TextCrud) | ||||
| 		//TextCrud = create_files.Convert_RequestIdToAlias(TextCrud, Table1) | ||||
| 		//добавим импорт uuid | ||||
|   | ||||
		Reference in New Issue
	
	Block a user