{"id":21851930,"url":"https://github.com/ulbora/go-crud-mysql","last_synced_at":"2026-05-11T02:20:42.640Z","repository":{"id":87394561,"uuid":"97390351","full_name":"Ulbora/go-crud-mysql","owner":"Ulbora","description":"A curd library that wraps database access to MySQL , MariaDB, Percona Server, Google CloudSQL or Sphinx","archived":false,"fork":false,"pushed_at":"2018-06-09T17:33:41.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-26T13:22:31.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Ulbora.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":"2017-07-16T14:53:20.000Z","updated_at":"2020-12-24T08:18:36.000Z","dependencies_parsed_at":"2023-05-07T11:30:46.807Z","dependency_job_id":null,"html_url":"https://github.com/Ulbora/go-crud-mysql","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-crud-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-crud-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-crud-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-crud-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ulbora","download_url":"https://codeload.github.com/Ulbora/go-crud-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244846809,"owners_count":20520199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-28T01:12:28.272Z","updated_at":"2026-05-11T02:20:37.609Z","avatar_url":"https://github.com/Ulbora.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-crud-mysql \n==============\n\nGo Crud library for MySql\n\n# Installation\n\n```\n$ go get github.com/Ulbora/go-crud-mysql\n\n```\n\n# Usage\n\n## InitializeMysql\n\n```\nres = InitializeMysql(\"localhost:3306\", \"admin\", \"admin\", \"some_database\")\t\nif res != true {\n\t// do something\n}\n\n```\n\n## GetDb\n### Gets a pointer to the DB for creating transactions\n\n```\ndb = GetDb()\ntx, err := db.Begin()\n\n```\n\n## Insert\n\n```\nvar noTx *sql.Tx\nvar q = \"INSERT INTO table (title, created_date, text, client_id) VALUES (?, ?, ?, ?)\"\nvar a []interface{}\na = append(a, \"test insert 2\", time.Now(), \"some content text\", 125)\t\nsuccess, insID := Insert(noTx, q, a...)\n\n```\n\n## Update\n\n```\nvar noTx *sql.Tx\nvar q = \"UPDATE table set title = ?, modified_date = ?, text = ? where id = ? and client_id = ? \"\na := []interface{}{\"test insert update\", time.Now(), \"some content new text updated\", insertID, 125}\nsuccess := Update(noTx, q, a...)\n\n```\n\n## Get\n\n```\na := []interface{}{insertID, 125}\nvar q = \"select * from table WHERE id = ? and client_id = ?\"\nrowPtr := Get(q, a...)\nif rowPtr != nil {\n\tfoundRow := rowPtr.row\n}\n\n```\n\n## GetList\n\n```\na := []interface{}{125}\nvar q = \"select * from table WHERE client_id = ? order by id\"\nrowsPtr := GetList(q, a...)\nif rowsPtr != nil {\t\n\tfoundRows := rowsPtr.rows\n}\n\n```\n\n## Delete\n\n```\nvar noTx *sql.Tx\nvar q = \"DELETE FROM table WHERE id = ? \"\nsuccess := Delete(noTx, q, insertID)\n\n```\n\n\n## Close Database\n\n```\nsuccess := Close()\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fgo-crud-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulbora%2Fgo-crud-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fgo-crud-mysql/lists"}