Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the open-source essentials GoStructDB was missing and rewrites the docs so a newcomer can install it and get something working in a few minutes. Docs/metadata only: no Go code changed.
What's added
Copyright (c) 2026 SpaceTent(new; the repo had no licence, which legally means "all rights reserved")Testtable to exist first)Fixes to the old README (it didn't match the code)
gsdb.Save(entry, 0)→Saveis a method:gsdb.DB.Save(entry, entry.Id)ColumnWarnings = truewas described as turning warnings off; it turns them onGetCounter("test)had a missing quote### ShowSQLsection, now documentedreaddefault=null,omit=yes,MaxOpenConns/MaxIdleConns,Record/Fieldconverters,RecordInsert/RecordUpdate,NewSQLite3What I verified (go1.26.0, linux/amd64)
go build ./...go vet ./...go test ./...ok github.com/SpaceTent/GoStructDB/gsdbv0.0.14CGO_ENABLED=0behaviourexamples/procedure in examples/README.md (sqlite3 test.db "CREATE TABLE…"thenDSN=test.db go run main.go)Not verified: the MySQL steps (no MySQL server available here). The DSN format, lazy connect/ping and pool behaviour are documented from the code, not a live run.
Needs your decision
Things I noticed in the code (not changed in this PR)
These are documented honestly in the README where they affect users; worth separate issues/PRs:
InsertManygenerates invalid SQL for >1 row. Rows are joined with\nbut no comma:INSERT INTO t(n) VALUES (X'61')\n(X'62');. The README tells people to useInsertin a loop for now.getConnection()can deadlock: when the DSN is empty or all 3 connection attempts fail, it returns withoutDB.Lock.Unlock(), so the next call hangs forever.Updateare written unquoted in theWHEREclause (WHERE id=abc), which breaks and isn't escaped.RecordUpdate's value parameter is concatenated raw too.[]bytefields work for reads butInsert/Updatehit thedefaultbranch and panic onvalue.(string).QueryStructlogs every blob field at INFO (Setting Blob field ...), which is noisy.Databasestruct hasMaxDatabaseOpenConnections,MaxDatabaseIdleConnectionsandDatabaseIdleTimeoutfields that nothing reads (the package vars are used instead).actions/setup-go@v4with nogo-version. It works via toolchain download, butgo-version-file: go.modonsetup-go@v5would be more explicit. Just a suggestion; I didn't touch CI.Screenshots
GSDB is a library with no UI, so there are no screenshots. The README uses real program output in code blocks instead.