aboutsummaryrefslogtreecommitdiff
path: root/_content/doc/tutorial/database-access.md
AgeCommit message (Collapse)Author
2025-04-14_content/doc: use mysql.NewConfig() instead of mysql.Config{}Inada Naoki
The zero values for `mysql.Config` is not good for default. See https://pkg.go.dev/github.com/go-sql-driver/mysql#Config > If a new Config is created instead of being parsed from a DSN string, the NewConfig function should be used, which sets default values. Change-Id: Ib09cce4a61f8a73571e45797edcd5ea37f0704ce GitHub-Last-Rev: 1031334dc57e7458b66e82c6dc238bd1e1c317e1 GitHub-Pull-Request: golang/website#281 Reviewed-on: https://go-review.googlesource.com/c/website/+/582475 Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Sean Liao <sean@liao.dev>
2023-12-20all: fix and test for references to github.com/golang/go/issues and wikiRuss Cox
Insist on the canonical /issue/ and /wiki/ links instead. Change-Id: I7a2eedda69bc3fcd11466722a41f00c9dbaf283f Reviewed-on: https://go-review.googlesource.com/c/website/+/550323 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-02-14_content: Breadcrumbs added to children pages.Frederick Mixell
Added to all doc children page with doclayout. Added to Why Go pages. Added to Security pages. Video of Changes: https://drive.google.com/file/d/1wX9e9K9H9wPTaLLQHh15-cWzMTMRr9DO/view?usp=sharing Change-Id: I0fbf8e925e7fa357762d8eebd2bf13d561d49d86 Reviewed-on: https://go-review.googlesource.com/c/website/+/432775 Reviewed-by: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-06-15all: fix a lot of typosFrederik Zipp
Change-Id: I0754d18f4c3c3d5dfa0c34b4bc154a35ac20b917 Reviewed-on: https://go-review.googlesource.com/c/website/+/411794 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-02-18_content/doc/tutorial: fix number of rows in database-access.mdChia-Chi Hsu
"Add three rows with values" should be "Add four rows with values". Change-Id: I82103908292faf95c1b6c62ca57d6f47b0249ccb GitHub-Last-Rev: 2a0240372717014ccff4c511b71a43ba846db760 GitHub-Pull-Request: golang/website#126 Reviewed-on: https://go-review.googlesource.com/c/website/+/385594 Reviewed-by: DO NOT USE <iant@google.com> Trust: Dmitri Shuralyov <dmitshur@google.com>
2021-12-06_content: cancel spellingRuss Cox
canceled canceling cancellation Per https://go.dev/wiki/Spelling. Change-Id: I3e719a9f07e64259e6bcf02c9d15939069176538 Reviewed-on: https://go-review.googlesource.com/c/website/+/369714 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-11-22_content: update links to tourRuss Cox
Now the tour is just /tour, not https://tour.golang.org. Change-Id: Iebb2f7a5218b747896250815f4f46f62755e6a88 Reviewed-on: https://go-review.googlesource.com/c/website/+/365101 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22all: make golang.org and go.dev links relativeRuss Cox
Now that there is one site, update all golang.org links to go.dev. But for any links being served from go.dev, make host-relative, so that when serving golang.google.cn, we stay on that host as much as possible. Change-Id: Id6e1303059b5522846a64202bc1a8b81dc3854cd Reviewed-on: https://go-review.googlesource.com/c/website/+/365095 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-09-15x/website: fix bad indentation in tutorial -> database-accessdaiwt
Change-Id: I0ba4e67c02827aa8a985b24dbc208412a0721729 GitHub-Last-Rev: 463be1cb9f689eabe45284a0e284c03b31554fa3 GitHub-Pull-Request: golang/website#84 Reviewed-on: https://go-review.googlesource.com/c/website/+/344371 Reviewed-by: Akhil Indurti <aindurti@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org> Website-Publish: Russ Cox <rsc@golang.org>
2021-09-08_content/doc: module naming best practicesSteve Traut
This adds new content with best practices for the module path. It also revises existing content to use the best practice. This change includes: * A new "Naming a module" section in "Managing dependencies" describing naming best practices and reserved terms for module paths. * Changing module path prefix from "example.com/*" to "example/*" where the content seems aimed specifically at new users. This is designed to reduce confusion for those who wonder if a domain name is required in the local, simple context. * Links to the "Naming a module" section so that new users can follow up from the simple case to learn about best practices. Change-Id: I07eac1f805ce506a486d3c0e7b54539554e3c30b Reviewed-on: https://go-review.googlesource.com/c/website/+/344469 Trust: Steve Traut <straut@google.com> Trust: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-07-01_content/doc: add data access tutorial and guideSteve Traut
This adds an introductory tutorial on accessing relational databases, as well as a deeper dive data access guide comprising nine topics. This change includes: - A data access tutorial: - _content/doc/tutorial/database-access.md -- An introductory data access tutorial. - A data access guide: - _content/doc/database/index.md -- An overview of data access with Go. - _content/doc/database/open-handle -- On opening a database handle. - _content/doc/database/change-data -- On executing SQL statements that don't return data - _content/doc/database/querying -- On querying for data - _content/doc/database/prepared-statements -- On using prepared statements - _content/doc/database/execute-transactions -- On executing transactions - _content/doc/database/cancel-operations -- On using Context to support cancelling in-progress database operations - _content/doc/database/manage-connections -- On customizing the connection pool and using a reserved connection - _content/doc/database/sql-injection -- On using function parameters to avoid a SQL injection risk - Updates to index topics so that they list the new content. - _content/doc/index.html - _content/doc/tutorial/index.html Change-Id: Iab94d93e5d53e1379b22098c08d517b99cfa2c27 Reviewed-on: https://go-review.googlesource.com/c/website/+/331449 Reviewed-by: Russ Cox <rsc@golang.org> Website-Publish: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Steve Traut <straut@google.com>