{"id":37191296,"url":"https://github.com/plopezm/goedb","last_synced_at":"2026-01-14T22:09:20.488Z","repository":{"id":122053115,"uuid":"77616223","full_name":"plopezm/goedb","owner":"plopezm","description":"Goedb is a database manager to ease the persistence layer in a enterprise development","archived":false,"fork":false,"pushed_at":"2018-10-28T17:25:27.000Z","size":7803,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T15:44:02.336Z","etag":null,"topics":["database","datasource","entity-manager","orm","persistence"],"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/plopezm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-29T14:04:36.000Z","updated_at":"2018-10-28T12:25:50.000Z","dependencies_parsed_at":"2024-06-21T14:36:21.029Z","dependency_job_id":null,"html_url":"https://github.com/plopezm/goedb","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/plopezm/goedb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plopezm%2Fgoedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plopezm%2Fgoedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plopezm%2Fgoedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plopezm%2Fgoedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plopezm","download_url":"https://codeload.github.com/plopezm/goedb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plopezm%2Fgoedb/sbom","scorecard":{"id":737991,"data":{"date":"2025-08-11","repo":{"name":"github.com/plopezm/goedb","commit":"7ccf41ab2aa2e1228314249f607d7e986a662f58"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T16:28:26.771Z","repository_id":122053115,"created_at":"2025-08-22T16:28:26.772Z","updated_at":"2025-08-22T16:28:26.772Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["database","datasource","entity-manager","orm","persistence"],"created_at":"2026-01-14T22:09:19.859Z","updated_at":"2026-01-14T22:09:20.481Z","avatar_url":"https://github.com/plopezm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GOEDB (Go Easy Database Manager)\n[![Go Report Card](https://goreportcard.com/badge/github.com/plopezm/goedb)](https://goreportcard.com/report/github.com/plopezm/goedb) [![Build Status](https://travis-ci.org/plopezm/goedb.svg)](https://travis-ci.org/plopezm/goedb) [![codecov](https://codecov.io/gh/plopezm/goedb/branch/master/graph/badge.svg)](https://codecov.io/gh/plopezm/goedb)\n\nGoedb is a ORM for golang.\n\n\n# How To Use\n\n### Installation\n\nThis project uses [godep](https://github.com/golang/dep) for dependency management. To install the dependencies type the following:\n\n```\n    dep ensure\n```\n\n### Describing persistence.json\n\nThe file persistence.json will be used to define the datasource used at certain moment. It must be defined in the same directory as your program. A example of persistence.json is as follows:\n```\n    {\n      \"datasources\":[\n        {\n          \"name\": \"testSQLite3\",\n          \"driver\": \"sqlite3\",\n          \"url\": \"./test.db\"\n        },\n        {\n          \"name\": \"testSQLite3Test\",\n          \"driver\": \"sqlite3\",\n          \"url\": \":memory:\"\n        }\n      ]\n    }\n```\n\nCurrently multiple datasources can be defined. The name will be used as index to get the entity manager instance.\n\n### Using Goedb\n\nThe first step is to call \"Initialize()\" method. This method will get the information written in your persistence.json file and it initializes the structs. This method have to be called only once in your application.\n\n```\n\tgoedb.Initialize() // REQUIRED TO LOAD CONFIGURATION FROM persistence.json\n```\n\nOnce datasource is defined the next step is to get an instance of a entity manager. It requires the name of the datasource as input.\n\n```\n\tem, err = goedb.GetEntityManager(\"testSQLite3\")\n\tif err != nil {\n        fmt.Fprintf(os.Stderr, \"error: %v\\n\", err)\n        os.Exit(1)\n```\n\nNow the manager is ready to work with him, for example:\n\n```\n\tnewUC := \u0026TestUserCompany{\n\t\tEmail:\"Plm\",\n\t\tCif:\"asd2\",\n\t}\n\n\t_, err = em.Insert(newUC)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n```\n\nIn the current version, entity manager functionality is as follows:\n\n```\ntype EntityManager interface {\n    SetSchema(schema string) (sql.Result, error)\n    Open(driver string, params string, schema string) error\n    Close() error\n    GetDBConnection() *sqlx.DB\n    Migrate(i interface{}, autoCreate bool, dropIfExists bool) error\n    DropTable(i interface{}) error\n    Model(i interface{}) (metadata.GoedbTable, error)\n    Insert(i interface{}) (GoedbResult, error)\n    Update(i interface{}) (GoedbResult, error)\n    Remove(i interface{}, where string, params map[string]interface{}) (GoedbResult, error)\n    First(i interface{}, where string, params map[string]interface{}) error\n    Find(i interface{}, where string, params map[string]interface{}) error\n    NativeFirst(i interface{}, query string, params map[string]interface{}) error\n    NativeFind(i interface{}, query string, params map[string]interface{}) error\n    TxBegin() (*sql.Tx, error)\n}\n```\n\n# Struct annotations\n\n* `goedb:\"pk\"` -\u003e It marks a field as primary key. Primary key MUST be integer\n  * `goedb:\"pk,autoincrement\"` -\u003e Sets the column as primarykey autoincremented in database.\n* `goedb:\"unique\"` -\u003e It sets the column as unique.\n* `goedb:\"ignore\"` -\u003e Goedb will ignore the column annotated with ignore.\n* `goedb:\"fk=DestinationTable(PKColumn)\"` -\u003e It sets the column as foreign key\n\nExample\n\n```\ntype TestTroop struct {\n\tID       int           `goedb:\"pk,autoincrement\"`\n\tName     string        `goedb:\"unique\"`\n\tSoldiers []TestSoldier `goedb:\"ignore\"`\n}\n\ntype TestSoldier struct {\n\tID    int       `goedb:\"pk,autoincrement\"`\n\tName  string    `goedb:\"unique\"`\n\tTroop TestTroop `goedb:\"fk=TestTroop(ID)\"`\n}\n```\n\n# What is currently supported:\n\n- For simple entities: All -\u003e Tests in tests/Goedb_test.go\n- For composed entities: All -\u003e Tests in Goedb_ComplexStructs_test.go\n\n\n- Polymorphism is not supported\n- Named query supported in where clause. \n```\n\terr := em.First(soldier1, \"TestSoldier.Name = :name\", map[string]interface{}{\"name\": \"Ryan\"})\n```\n\n### Databases tested\n\n- SQLite3\n- PostgreSQL9\n\n# Example projects\n\n- [go-auth-ms](https://github.com/plopezm/go-auth-ms) \n\n# License\n\nCopyright 2017 plopezm \u003cpabloplm@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplopezm%2Fgoedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplopezm%2Fgoedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplopezm%2Fgoedb/lists"}