Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add and improve examples of connections, queries and more #2337

Merged
merged 29 commits into from
Jan 6, 2024

Conversation

wellwelwel
Copy link
Collaborator

@wellwelwel wellwelwel commented Jan 4, 2024

Documentation 📝

Adding examples of the most common methods and simple queries (such as CRUD).

I don't intend to interfere in the documentation itself, but I plan to contribute with some examples, including simplifying TypeScript compilation tests to reuse as examples (JS).


Prepared Statement examples:

Both promise and callback.

execute(sql, values)

  • INSERT
  • SELECT
  • UPDATE
  • DELETE

execute(options)

  • INSERT
  • SELECT
  • UPDATE
  • DELETE

execute(options, values)

  • INSERT
  • SELECT
  • UPDATE
  • DELETE

Simple queries examples:

Both promise and callback.

query(sql)

  • INSERT
  • SELECT
  • UPDATE
  • DELETE

query(options)

  • INSERT
  • SELECT
  • UPDATE
  • DELETE
  • Include an example using rowAsArray

Connections

Both promise and callback.

createConnection

  • createConnection(connectionUri)
  • createConnection(config)
  • createConnection(config) — SHA1
  • createConnection(config) — SSL
  • createConnection(config) — RDS SSL
  • createConnection(config) — Socks
    • Only callback

createPool

  • createPool(connectionUri)
  • createPool(config)
  • createPool(config) — SHA1
  • createPool(config) — SSL
  • createPool(config) — RDS SSL
  • createPool(config) — Socks
    • Only callback

createPoolCluster

  • add(group, connectionUri)
  • add(group, config)
  • add(group, config) — SHA1
  • add(group, config) — SSL
  • add(group, config) — RDS SSL
  • add(group, config) — Socks
    • Only callback

And more "chore" 🧑🏻‍🔧


Website 🔬

  • Add unit tests to website's helpers
  • Fix website's package-lock.json conflict between local development and dependabot
  • Extract methods as string to reuse in specifications (inspired by https://tsdocs.dev)
    • It will prevent possible differences between the documentation and the source code.
  • Document the ExternalCodeEmbed component
  • Restrict extensions to mdx and json in the "docs" and "i18n" directories.
  • Check for broken links
  • Include new tests to CI

@wellwelwel wellwelwel added in progress documentation website Website features, issues, etc. that aren't directly related to the documentation. labels Jan 4, 2024
@wellwelwel wellwelwel changed the title docs: add examples docs: add and improved examples of connections, queries and more Jan 6, 2024
@wellwelwel wellwelwel changed the title docs: add and improved examples of connections, queries and more docs: add and improve examples of connections, queries and more Jan 6, 2024
@wellwelwel wellwelwel merged commit 323ab12 into sidorares:master Jan 6, 2024
58 checks passed
@wellwelwel wellwelwel deleted the examples branch January 7, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation website Website features, issues, etc. that aren't directly related to the documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant