GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-95273: Move sqlite3 executemany examples from reference to tutorial by erlend-aasland · Pull Request #95351 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jul 27, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Improve the sqlite3 reference #95273

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
pythongh-95273: Move sqlite3 executemany examples from reference to t…
6a5cb61
…utorial
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner July 27, 2022 22:42
@erlend-aasland
erlend-aasland requested review from AlexWaygood and CAM-Gerlach July 27, 2022 22:42
@bedevere-bot bedevere-bot added the awaiting core review label Jul 27, 2022
@erlend-aasland erlend-aasland mentioned this pull request Jul 27, 2022
Improve the sqlite3 reference #95273
Closed
5 tasks done
@erlend-aasland erlend-aasland added the skip news label Jul 27, 2022
@erlend-aasland

erlend-aasland commented Jul 27, 2022

Copy link
Copy Markdown
Contributor Author

My 2 cents:

The executemany examples are way more complex than the average user needs. We should focus on the sqlite3 module; not on writing fancy iterators.

The only thing that bothers me, is that we do not explicitly mention that the cursor can be used as an iterator. We could add a mention in the cursor class description.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

CAM-Gerlach
CAM-Gerlach reviewed Jul 28, 2022
View reviewed changes

@CAM-Gerlach CAM-Gerlach left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor comments, otherwise LGTM. Thanks @erlend-aasland !

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
Comment thread Doc/library/sqlite3.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/sqlite3.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend Egeberg Aasland and others added 2 commits July 28, 2022 08:40
Erlend Egeberg Aasland @CAM-Gerlach
Update Doc/library/sqlite3.rst
a4f6dad
Co-authored-by: CAM Gerlach <[email protected]>
Erlend Egeberg Aasland @CAM-Gerlach
Update Doc/library/sqlite3.rst
00a335f
Co-authored-by: CAM Gerlach <[email protected]>
@erlend-aasland

erlend-aasland commented Jul 28, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

The only thing that bothers me, is that we do not explicitly mention that the cursor can be used as an iterator. We could add a mention in the cursor class description.

I've already got this covered in the #95273 todo list. UPDATE: PR => #95379

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood

AlexWaygood commented Jul 28, 2022

Copy link
Copy Markdown
Member

I've got quite a lot on at the moment, so I'll leave this one in @CAM-Gerlach's very capable hands, if that's okay!

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
AlexWaygood removed their request for review July 28, 2022 07:27
@erlend-aasland

erlend-aasland commented Jul 28, 2022

Copy link
Copy Markdown
Contributor Author

I wonder if it may make sense to keep a minimum example in the reference, though. The two previous examples ate more than a screenful. How about leaving something like this:

data = [
    ("row1",),
    ("row2",),
]
cur.executemany("insert into t values(?)", data)
CAM-Gerlach reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland added 2 commits July 28, 2022 15:14
@erlend-aasland
Fix inlined code syntax
c76b51d
@erlend-aasland
Add small example
3666299
@CAM-Gerlach

CAM-Gerlach commented Jul 29, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

How about leaving something like this:

SGTM; concise examples can certainly be helpful to aiding understanding and this one certainly helps me understand the purpose of executemany much better (at least as a relative novice)

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

CAM-Gerlach
CAM-Gerlach approved these changes Jul 29, 2022
View reviewed changes

@CAM-Gerlach CAM-Gerlach left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @erlend-aasland 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
erlend-aasland
erlend-aasland commented Jul 29, 2022
View reviewed changes
Comment thread Doc/library/sqlite3.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend Egeberg Aasland
Update Doc/library/sqlite3.rst
598d9d8
@erlend-aasland
erlend-aasland merged commit f0bf795 into python:main Jul 29, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 29, 2022
@erlend-aasland
erlend-aasland deleted the sqlite-reference/extract-executemany-example branch July 29, 2022 07:42
@erlend-aasland erlend-aasland added needs backport to 3.10 needs backport to 3.11 only security fixes labels Jul 29, 2022
@miss-islington

miss-islington commented Jul 29, 2022

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 29, 2022

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 29, 2022
Erlend Egeberg Aasland @miss-islington
pythongh-95273: Move sqlite3 executemany examples from reference to t…
946ab9c
…utorial (pythonGH-95351)

(cherry picked from commit f0bf795)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Jul 29, 2022
@bedevere-bot

bedevere-bot commented Jul 29, 2022

Copy link
Copy Markdown

GH-95420 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 29, 2022
Erlend Egeberg Aasland @miss-islington
pythongh-95273: Move sqlite3 executemany examples from reference to t…
5b1044d
…utorial (pythonGH-95351)

(cherry picked from commit f0bf795)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 29, 2022
@bedevere-bot

bedevere-bot commented Jul 29, 2022

Copy link
Copy Markdown

GH-95421 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington added a commit that referenced this pull request Jul 29, 2022
@miss-islington Erlend Egeberg Aasland
gh-95273: Move sqlite3 executemany examples from reference to tutorial (
f59a5c5
GH-95351)

(cherry picked from commit f0bf795)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
miss-islington added a commit that referenced this pull request Jul 29, 2022
@miss-islington Erlend Egeberg Aasland
gh-95273: Move sqlite3 executemany examples from reference to tutorial (
f06f365
GH-95351)

(cherry picked from commit f0bf795)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@erlend-aasland erlend-aasland linked an issue Aug 1, 2022 that may be closed by this pull request
Improve the sqlite3 reference #95273
Closed
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@CAM-Gerlach CAM-Gerlach CAM-Gerlach approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Improve the sqlite3 reference

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @AlexWaygood @CAM-Gerlach @miss-islington @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.