{"id":34208023,"url":"https://github.com/custompbx/customorm","last_synced_at":"2026-03-12T17:32:24.663Z","repository":{"id":63041263,"uuid":"563573652","full_name":"custompbx/customorm","owner":"custompbx","description":"SQL generator based on structures tags","archived":false,"fork":false,"pushed_at":"2024-06-04T23:14:10.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-19T00:17:56.700Z","etag":null,"topics":["freeswitch","golang","orm","postgresql","sql","voip"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/custompbx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-08T22:26:32.000Z","updated_at":"2025-03-21T12:15:07.000Z","dependencies_parsed_at":"2022-11-11T17:30:31.337Z","dependency_job_id":null,"html_url":"https://github.com/custompbx/customorm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/custompbx/customorm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custompbx%2Fcustomorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custompbx%2Fcustomorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custompbx%2Fcustomorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custompbx%2Fcustomorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/custompbx","download_url":"https://codeload.github.com/custompbx/customorm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custompbx%2Fcustomorm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30435194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freeswitch","golang","orm","postgresql","sql","voip"],"created_at":"2025-12-15T20:11:14.809Z","updated_at":"2026-03-12T17:32:24.655Z","avatar_url":"https://github.com/custompbx.png","language":"Go","readme":"Here's an improved version of your README:\n\n# CustomORM\n\nCustomORM is not a full-fledged ORM but rather a collection of functions designed to generate and execute SQL queries based on specific struct definitions. It is tailored for PostgreSQL databases.\n\n## Features\n\n- Generate and execute SQL queries based on struct definitions\n- Designed to work seamlessly with PostgreSQL databases\n- Support for table creation, insertion, updating, deletion, and querying\n\n## Usage\n\n### Struct Definitions\n\nDefine your structs with tags specifying SQL constraints and properties:\n\n```go\ntype Domain struct {\n\tId      int64  `json:\"id\" customsql:\"pkey:id;check(id \u003c\u003e 0)\"`\n\tEnabled bool   `json:\"enabled\" customsql:\"enabled;default=TRUE\"`\n\tName    string `json:\"name\" customsql:\"name;unique;check(name \u003c\u003e '')\"`\n}\n\nfunc (d *Domain) GetTableName() string {\n    return \"domains\"\n}\n\ntype DomainUser struct {\n\tId      int64    `json:\"id\" customsql:\"pkey:id;check(id \u003c\u003e 0)\"`\n\tPosition int64    `json:\"position\" customsql:\"position;position\"`\n\tEnabled bool     `json:\"enabled\" customsql:\"enabled;default=TRUE\"`\n\tName    string   `json:\"name\" customsql:\"name;unique_1;check(name \u003c\u003e '')\"`\n\tParent  *Domain  `json:\"parent\" customsql:\"fkey:parent_id;unique_1;check(parent_id \u003c\u003e 0)\"`\n}\n\nfunc (d *DomainUser) GetTableName() string {\n    return \"domain_users\"\n}\n```\nThe tags `unique` and `index` can be grouped using an underscore, such as `unique_1`. To set the order within a group, add a suffix after a hyphen, for example, `index_1-1` and `index_1-2`.\n\n### Creating Tables\n\n```go\ncorm := customorm.Init(db)\ncorm.CreateTable(\u0026Domain{})     // Returns bool\ncorm.CreateTable(\u0026DomainUser{}) // Returns bool\n```\n\n### Inserting Rows\n\n```go\ncorm := customorm.Init(db)\ncorm.InsertRow(\u0026DomainUser{\n    Name:    \"UserName\",\n    Parent:  \u0026altStruct.Domain{Id: parentId},\n    Enabled: true,\n}) // Returns int64, error\n```\n\n### Updating Rows\n\n```go\ncorm := customorm.Init(db)\ncorm.UpdateRow(\u0026DomainUser{\n    Id:   1,\n    Name: \"NewUserName\",\n}, true, map[string]bool{\"Name\": true}) // Returns error\n```\n\n### Deleting Rows\n\n```go\ncorm := customorm.Init(db)\ncorm.DeleteRowById(\u0026DomainUser{Id: 1})           // Returns error\ncorm.DeleteRowByArgId(\u0026DomainUser{}, 1)          // Returns error\ncorm.DeleteRows(\u0026DomainUser{Enabled: false}, map[string]bool{\"Enabled\": true}) // Returns error\n```\n\n### Querying Rows\n\n```go\ncorm := customorm.Init(db)\ncorm.GetDataAll(\u0026DomainUser{}, true) // Returns interface{}, error\n\nfilter := customOrm.Filters{\n    Fields: map[string]FilterFields{\n        \"Name\": {\n            Flag:      true, // Use this filter\n            UseValue:  false, // Use value from struct or from value field below\n            Value:     nil, // Can use this value instead of value from struct\n            Operand:   \"\", // Operand to compare with value of (\u003c,\u003e,=,CONTAINS,IN) default \"=\"\n        },\n    },\n    Order: customOrm.Order{\n        Desc:   true, // Sort DESC\n        Fields: []string{\"Id\"}, // Sort by field names\n    },\n    Limit:  10,\n    Offset: 0,\n    Count:  false, // If true, returns count(*) instead of fields\n}\n\ncorm.GetDataByValue(\u0026DomainUser{Id: 1}, filter, false) // Returns interface{}, error\n```\n\nFeel free to adjust and expand upon these examples to suit your specific use cases.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustompbx%2Fcustomorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustompbx%2Fcustomorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustompbx%2Fcustomorm/lists"}