Idea: conversions= could take Python functions
Open
Nobody has claimed this yet.
python-library
research
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 172
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
Right now you use conversions= like this:
db["example"].insert({
"name": "The Bigfoot Discovery Museum"
}, conversions={"name": "upper(?)"})
How about if you could optionally provide a Python function (or a lambda) like this?
db["example"].insert({
"name": "The Bigfoot Discovery Museum"
}, conversions={"name": lambda s: s.upper()})
This would work by creating a random name for that function, registering it (similar to #162), executing the SQL and then un-registering the custom function at the end.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing conversions= handling in the Python database API and read issue #162 for the related custom-function registration approach. Done means conversions= accepts a Python function or lambda, executes the SQL using a registered function, and unregisters it afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100