url
stringlengths
53
56
repository_url
stringclasses
1 value
labels_url
stringlengths
67
70
comments_url
stringlengths
62
65
events_url
stringlengths
60
63
html_url
stringlengths
41
46
id
int64
450k
1.69B
node_id
stringlengths
18
32
number
int64
1
2.72k
title
stringlengths
1
209
user
dict
labels
list
state
stringclasses
1 value
locked
bool
2 classes
assignee
null
assignees
list
milestone
null
comments
list
created_at
timestamp[s]
updated_at
timestamp[s]
closed_at
timestamp[s]
author_association
stringclasses
3 values
active_lock_reason
stringclasses
2 values
body
stringlengths
0
104k
reactions
dict
timeline_url
stringlengths
62
65
performed_via_github_app
null
state_reason
stringclasses
2 values
draft
bool
2 classes
pull_request
dict
https://api.github.com/repos/coleifer/peewee/issues/2619
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2619/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2619/comments
https://api.github.com/repos/coleifer/peewee/issues/2619/events
https://github.com/coleifer/peewee/issues/2619
1,381,400,756
I_kwDOAA7yGM5SVoC0
2,619
test_murmur_hash fails on s390x architecture
{ "login": "carlwgeorge", "id": 12187228, "node_id": "MDQ6VXNlcjEyMTg3MjI4", "avatar_url": "https://avatars.githubusercontent.com/u/12187228?v=4", "gravatar_id": "", "url": "https://api.github.com/users/carlwgeorge", "html_url": "https://github.com/carlwgeorge", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "What does `platform.machine()` return on that hardware, out of curiosity? I'm sure this is just an endianness thing, so we can just add a conditional to skip the test.", "```\r\n>>> platform.machine()\r\n's390x'\r\n```", "Just FYI I tagged a new release, 3.15.3." ]
2022-09-21T19:32:25
2022-09-22T02:56:57
2022-09-21T22:59:02
CONTRIBUTOR
null
While running the tests on the s390x architecture for a Fedora build, I'm seeing this failure. ``` ====================================================================== FAIL: test_murmur_hash (tests.sqlite.TestMurmurHash.test_murmur_hash) ---------------------------------------------------------------------- Tr...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2619/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2619/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2618
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2618/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2618/comments
https://api.github.com/repos/coleifer/peewee/issues/2618/events
https://github.com/coleifer/peewee/issues/2618
1,380,459,748
I_kwDOAA7yGM5SSCTk
2,618
Pwiz exporting of postgres materialized view
{ "login": "surfer190", "id": 3285222, "node_id": "MDQ6VXNlcjMyODUyMjI=", "avatar_url": "https://avatars.githubusercontent.com/u/3285222?v=4", "gravatar_id": "", "url": "https://api.github.com/users/surfer190", "html_url": "https://github.com/surfer190", "followers_url": "https://api.github.com/users/su...
[]
closed
false
null
[]
null
[ "Do you see your materialized view when running:\r\n\r\n```sql\r\nselect viewname, definition from pg_catalog.pg_views \r\nwhere schemaname = 'public' order by tablename; -- change schema name if differs\r\n```", "Oh wait, nevermind, I see that they're listed separately in `pg_catalog.pg_matviews`.", "For now I...
2022-09-21T07:29:25
2022-09-22T18:53:08
2022-09-21T14:29:31
NONE
null
Pwiz exports an existing db into models that can be written to a file. The [documentation mentions that the `-v` flag](https://docs.peewee-orm.com/en/latest/peewee/playhouse.html?highlight=generating%20models#pwiz-a-model-generator) can be used to export views. I tried using `pwiz` with the `-v` flag and a materi...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2618/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2618/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2617
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2617/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2617/comments
https://api.github.com/repos/coleifer/peewee/issues/2617/events
https://github.com/coleifer/peewee/issues/2617
1,380,039,487
I_kwDOAA7yGM5SQbs_
2,617
test_insert_behavior fails on Python 3.11
{ "login": "carlwgeorge", "id": 12187228, "node_id": "MDQ6VXNlcjEyMTg3MjI4", "avatar_url": "https://avatars.githubusercontent.com/u/12187228?v=4", "gravatar_id": "", "url": "https://api.github.com/users/carlwgeorge", "html_url": "https://github.com/carlwgeorge", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "I wonder if this is a regression in the standard lib sqlite3. Is it possible for you to also try pip installing `pysqlite3` and see if the test passes? Peewee should try to use pysqlite3, you can check by running:\r\n\r\n```\r\nfrom peewee import sqlite3\r\nprint(sqlite3)\r\n```\r\n\r\nThis should hopefully be pys...
2022-09-20T21:55:03
2022-10-03T13:14:13
2022-09-21T14:32:26
CONTRIBUTOR
null
While running the tests with Python 3.11.0rc2, I'm seeing this failure. ``` FAIL: test_insert_behavior (tests.sqlite.TestSqliteReturningConfig.test_insert_behavior) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/carl/development/peewee/test...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2617/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2617/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2616
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2616/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2616/comments
https://api.github.com/repos/coleifer/peewee/issues/2616/events
https://github.com/coleifer/peewee/issues/2616
1,376,901,892
I_kwDOAA7yGM5SEdsE
2,616
Add operator overloading for joins
{ "login": "valq7711", "id": 11394363, "node_id": "MDQ6VXNlcjExMzk0MzYz", "avatar_url": "https://avatars.githubusercontent.com/u/11394363?v=4", "gravatar_id": "", "url": "https://api.github.com/users/valq7711", "html_url": "https://github.com/valq7711", "followers_url": "https://api.github.com/users/val...
[]
closed
false
null
[]
null
[ "Sorry, that's not going to work, as we overload those already for the creation of expressions. This would require treating expression objects differently in the context of the `.join()` method. The way you've got `.on()` and the absence of parentheses presents even more difficulties.", "Sorry, but I don't see th...
2022-09-18T00:10:17
2022-09-19T17:33:53
2022-09-18T13:34:16
NONE
null
@coleifer Hi! Thank you for great project! So I have an idea: ```python query = (Foo .select(...) .join( Foo.t & Bar.t.on(...) # INNER JOIN + Baz.t.on(), # LEFT JOIN # switch to Foo-context (notice comma above) Foo.t ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2616/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2616/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2615
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2615/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2615/comments
https://api.github.com/repos/coleifer/peewee/issues/2615/events
https://github.com/coleifer/peewee/issues/2615
1,360,858,256
I_kwDOAA7yGM5RHQyQ
2,615
Expression syntax should properly handle chained expressions like `a <= expr <= b`
{ "login": "jonashaag", "id": 175722, "node_id": "MDQ6VXNlcjE3NTcyMg==", "avatar_url": "https://avatars.githubusercontent.com/u/175722?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jonashaag", "html_url": "https://github.com/jonashaag", "followers_url": "https://api.github.com/users/jona...
[]
closed
false
null
[]
null
[ "I don't know that we're able to do this, actually:\r\n\r\n```python\r\nIn [1]: class Expr(object):\r\n ...: def __init__(self, lhs, op, rhs):\r\n ...: self.lhs, self.op, self.rhs = lhs, op, rhs\r\n ...: def __str__(self):\r\n ...: return '%s %s %s' % (self.lhs, self.op, self.rhs)\r\...
2022-09-03T13:29:53
2022-09-04T16:24:57
2022-09-04T15:18:59
CONTRIBUTOR
null
IMO Peewee should support chained expressions like `a <= expr <= b` or raise an error. ```py # M = my model. # As expected, there are 3 objects with id <= 3. In [33]: list(M.select(M.id).where(M.id <= 3).tuples()) Out[33]: [(1,), (2,), (3,)] # Unexpected: Ignores the first constraint. In [34]: list(M.select(...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2615/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2615/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2614
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2614/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2614/comments
https://api.github.com/repos/coleifer/peewee/issues/2614/events
https://github.com/coleifer/peewee/issues/2614
1,360,532,538
I_kwDOAA7yGM5RGBQ6
2,614
Add Example for Idiomatic Message Queue Pattern
{ "login": "zackees", "id": 6856673, "node_id": "MDQ6VXNlcjY4NTY2NzM=", "avatar_url": "https://avatars.githubusercontent.com/u/6856673?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zackees", "html_url": "https://github.com/zackees", "followers_url": "https://api.github.com/users/zackees/...
[]
closed
false
null
[]
null
[ "I'm not going to do your homework for you, but there is a ton of discussion on this on the web. Some of it depends on what database you use, postgres probably being the most commonly discussed.\r\n\r\n* https://github.com/que-rb/que - https://github.com/que-rb/que/blob/master/lib/que/poller.rb#L60-L113\r\n* https:...
2022-09-02T19:17:55
2022-09-02T22:04:49
2022-09-02T19:40:25
NONE
null
Hi there. Great piece of software. I'm a novice at databases which has brought me to this solution. I'm looking for examples on the internet for how to use Peewee to implement a Message Queue. The challenges here is that the message queue is highly sensitive to locking multiple entries in the queue so that they can ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2614/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2614/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2613
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2613/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2613/comments
https://api.github.com/repos/coleifer/peewee/issues/2613/events
https://github.com/coleifer/peewee/issues/2613
1,352,445,776
I_kwDOAA7yGM5QnK9Q
2,613
AttributeError when calling len of model
{ "login": "ghost", "id": 10137, "node_id": "MDQ6VXNlcjEwMTM3", "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ghost", "html_url": "https://github.com/ghost", "followers_url": "https://api.github.com/users/ghost/followers", "f...
[]
closed
false
null
[]
null
[ "This looks like some issue with your debugger / pycharm. The `__len__()` / `count` behavior is covered by unit tests. `peewee.fn` is an instance of `Function` and implements some magic -- possibly your debugger is shadowing the `fn` name. Not sure.", "I think that must be something to do with it. I tried renamin...
2022-08-26T15:52:45
2022-08-26T17:56:00
2022-08-26T15:56:58
NONE
null
I'm getting an AttributeError when I call len on my Model class. Weirdly this occurs when I run a test in the pycharm debugger but not when I run the same test outside the debugger. Python Version 3.10.4 Peewee Version 3.15.1 ``` ../../src/stores/fs.py:79: in rows return len(self.model) ../../venv/lib/py...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2613/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2613/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2612
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2612/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2612/comments
https://api.github.com/repos/coleifer/peewee/issues/2612/events
https://github.com/coleifer/peewee/issues/2612
1,352,421,939
I_kwDOAA7yGM5QnFIz
2,612
Pylint complains that subclasses of `ColumnBase` leave `__iter__()` unimplemented
{ "login": "jborman-exos", "id": 94395044, "node_id": "U_kgDOBaBapA", "avatar_url": "https://avatars.githubusercontent.com/u/94395044?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jborman-exos", "html_url": "https://github.com/jborman-exos", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "No problem, fixed." ]
2022-08-26T15:29:49
2022-08-26T15:51:10
2022-08-26T15:51:10
NONE
null
Related to the fix released for #2606, running pylint over a local subclass of `ColumnBase` raises the following: ``` Method '__iter__' is abstract in class 'ColumnBase' but is not overridden (abstract-method) ``` Raising `NotimplementedError` implies that a concrete class is meant to implement this abstract me...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2612/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2612/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2611
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2611/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2611/comments
https://api.github.com/repos/coleifer/peewee/issues/2611/events
https://github.com/coleifer/peewee/pull/2611
1,352,331,434
PR_kwDOAA7yGM493uqO
2,611
Add `SelectBase.scalars()`
{ "login": "ilyakamens", "id": 3293811, "node_id": "MDQ6VXNlcjMyOTM4MTE=", "avatar_url": "https://avatars.githubusercontent.com/u/3293811?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ilyakamens", "html_url": "https://github.com/ilyakamens", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "There are a few issues with your patch - it consumes the entire cursor in one go and returns a list, when it would probably be better suited to use a generator. Similarly, it is not carrying through the `database` parameter. I will implement a similar patch and merge it.", "Thank you!" ]
2022-08-26T14:17:06
2022-11-20T16:09:05
2022-08-26T14:31:51
CONTRIBUTOR
null
Mr. Leifer, thanks for creating and maintaining such a great library. We've used peewee at Propel since 2015. This PR adds `SelectBase.scalars()`, which is something we've wanted for a while. `scalar()` is very convenient, and we thought something similar for multiple values would be too. I've proposed `scalars()` a...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2611/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2611/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2611", "html_url": "https://github.com/coleifer/peewee/pull/2611", "diff_url": "https://github.com/coleifer/peewee/pull/2611.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2611.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2610
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2610/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2610/comments
https://api.github.com/repos/coleifer/peewee/issues/2610/events
https://github.com/coleifer/peewee/issues/2610
1,351,681,427
I_kwDOAA7yGM5QkQWT
2,610
Operator does not exist: json = json?
{ "login": "andycasey", "id": 504436, "node_id": "MDQ6VXNlcjUwNDQzNg==", "avatar_url": "https://avatars.githubusercontent.com/u/504436?v=4", "gravatar_id": "", "url": "https://api.github.com/users/andycasey", "html_url": "https://github.com/andycasey", "followers_url": "https://api.github.com/users/andy...
[]
closed
false
null
[]
null
[ "Sorry, I just found #2504. Closing." ]
2022-08-26T02:59:56
2022-08-26T03:06:52
2022-08-26T03:06:52
NONE
null
👋🏻 thanks for peewee, it's awesome. I'm having troubles with `playhouse.postgres_ext.JSONField`. The minimum reproducible code is: ```python from playhouse.postgres_ext import * database = PostgresqlExtDatabase(...) class DataProduct(Model): class Meta: database = database id = Auto...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2610/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2610/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2609
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2609/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2609/comments
https://api.github.com/repos/coleifer/peewee/issues/2609/events
https://github.com/coleifer/peewee/issues/2609
1,351,468,945
I_kwDOAA7yGM5QjceR
2,609
[MySQL] [playhouse] [JSONField] contains() on the JSONField causes error: Incorrect arguments to ESCAPE
{ "login": "recipe", "id": 1947600, "node_id": "MDQ6VXNlcjE5NDc2MDA=", "avatar_url": "https://avatars.githubusercontent.com/u/1947600?v=4", "gravatar_id": "", "url": "https://api.github.com/users/recipe", "html_url": "https://github.com/recipe", "followers_url": "https://api.github.com/users/recipe/foll...
[]
closed
false
null
[]
null
[ "The query seems to work fine for the `name` column but it does not appear to be working with the JSON type.\r\n\r\n```python\r\nReg.insert_many(\r\n [\r\n {\"id\": 1, \"name\": \"bar \\\\ 1\", \"message\": [\"a \\\\ b\"]},\r\n {\"id\": 2, \"name\": \"bar\", \"message\": [\"a \\\\\\\\ b\"]},\r\n ...
2022-08-25T21:29:17
2022-08-26T14:09:46
2022-08-26T02:36:40
NONE
null
Having the following script that replicates the issue: ```python #!/usr/bin/env python from peewee import * from playhouse import mysql_ext db = MySQLDatabase( "db", host="localhost", port=3306, user="user", password="password" ) class t1(Model): id = IntegerField(primary_key=True) name = ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2609/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2609/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2608
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2608/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2608/comments
https://api.github.com/repos/coleifer/peewee/issues/2608/events
https://github.com/coleifer/peewee/issues/2608
1,347,249,931
I_kwDOAA7yGM5QTWcL
2,608
Consider exposing the underlying query in `prefetch()`
{ "login": "ilyakamens", "id": 3293811, "node_id": "MDQ6VXNlcjMyOTM4MTE=", "avatar_url": "https://avatars.githubusercontent.com/u/3293811?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ilyakamens", "html_url": "https://github.com/ilyakamens", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "Prefetch does not expose a query because the results are not composed of a single query, but rather `k` queries for however many tables are being prefetched. Dependent rows are iterated and an in-memory map is built for efficiently assigning them to their parent model instance/row. They're not able to be composed ...
2022-08-23T02:45:53
2022-08-23T13:16:01
2022-08-23T12:51:34
CONTRIBUTOR
null
Mr. Leifer, Thanks for creating and maintaining such a great library. We've used it at Propel since August 18, 2015 starting with version 2.6.2. I'd like to use `prefetch()` to avoid N+1 queries, but am having trouble doing so because `prefetch()` returns a list instead of a query. We use peewee queries (e.g., `U...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2608/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2608/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2607
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2607/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2607/comments
https://api.github.com/repos/coleifer/peewee/issues/2607/events
https://github.com/coleifer/peewee/issues/2607
1,346,108,983
I_kwDOAA7yGM5QO_43
2,607
Declarative table partitioning (Postgres)
{ "login": "foobarto", "id": 271036, "node_id": "MDQ6VXNlcjI3MTAzNg==", "avatar_url": "https://avatars.githubusercontent.com/u/271036?v=4", "gravatar_id": "", "url": "https://api.github.com/users/foobarto", "html_url": "https://github.com/foobarto", "followers_url": "https://api.github.com/users/foobart...
[]
closed
false
null
[]
null
[ "Here's an example. You can use `Meta.table_settings`:\r\n\r\nhttps://github.com/coleifer/peewee/blob/master/tests/schema.py#L433-L448\r\n\r\n```python\r\n def test_table_settings(self):\r\n class KVSettings(TestModel):\r\n key = TextField(primary_key=True)\r\n value = TextField()\r\...
2022-08-22T09:35:41
2022-08-22T12:11:00
2022-08-22T12:10:32
NONE
null
I'm trying to figure out how to create a table with [declarative partitioning in Postgres](https://www.postgresql.org/docs/current/ddl-partitioning.html) so the syntax looks like this: ```sql CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktemp int, ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2607/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2607/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2606
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2606/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2606/comments
https://api.github.com/repos/coleifer/peewee/issues/2606/events
https://github.com/coleifer/peewee/issues/2606
1,343,503,900
I_kwDOAA7yGM5QFD4c
2,606
iterating or extending `Function` produces an infinite loop
{ "login": "joshkaplan", "id": 5589260, "node_id": "MDQ6VXNlcjU1ODkyNjA=", "avatar_url": "https://avatars.githubusercontent.com/u/5589260?v=4", "gravatar_id": "", "url": "https://api.github.com/users/joshkaplan", "html_url": "https://github.com/joshkaplan", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "We don't want to raise an IndexError since it is not inherently an iterable type, so I'm going with NotImplementedError for now.", "3.15.2 released now, which contains this fix." ]
2022-08-18T19:12:16
2022-08-26T14:10:05
2022-08-18T19:30:19
NONE
null
### Problem Both of these examples produce an infinite loop: ```python3 import peewee pwf = peewee.fn.count() # example 1: for i in pwf: print(f'hello {str(i)}') # example 2: x = [] x.extend(pwf) ``` The offending code is `ColumnBase.__getitem__`: https://github.com/coleifer/peewee/blob/master...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2606/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2606/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2605
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2605/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2605/comments
https://api.github.com/repos/coleifer/peewee/issues/2605/events
https://github.com/coleifer/peewee/issues/2605
1,341,043,315
I_kwDOAA7yGM5P7rJz
2,605
allow non-atomic get_or_create?
{ "login": "mayli", "id": 822628, "node_id": "MDQ6VXNlcjgyMjYyOA==", "avatar_url": "https://avatars.githubusercontent.com/u/822628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mayli", "html_url": "https://github.com/mayli", "followers_url": "https://api.github.com/users/mayli/followers"...
[]
closed
false
null
[]
null
[ "You are welcome to write your own implementation and place it on a `Base` model class you use." ]
2022-08-17T01:14:30
2022-08-17T12:45:51
2022-08-17T12:45:51
NONE
null
The current [get_or_create](https://github.com/coleifer/peewee/blob/eeff376be5af089e7d3849284a1c1d71b5df215f/peewee.py#L6626-L6627) requires the db supports `atomic()`, which is not necessary in most cases. Is it possible add a parameter to allow non-atomic `get_or_create`?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2605/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2605/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2604
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2604/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2604/comments
https://api.github.com/repos/coleifer/peewee/issues/2604/events
https://github.com/coleifer/peewee/issues/2604
1,338,361,492
I_kwDOAA7yGM5PxcaU
2,604
TypeError: super(type, obj): obj must be an instance or subtype of type
{ "login": "jramosss", "id": 52583728, "node_id": "MDQ6VXNlcjUyNTgzNzI4", "avatar_url": "https://avatars.githubusercontent.com/u/52583728?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jramosss", "html_url": "https://github.com/jramosss", "followers_url": "https://api.github.com/users/jra...
[]
closed
false
null
[]
null
[ "`get()` is a classmethod. Check out the following:\r\n\r\n```python\r\nclass BaseModel(Model):\r\n @classmethod\r\n def get(cls, *query, **filters):\r\n print('get() called on base.')\r\n return super(BaseModel, cls).get(*query, **filters)\r\n class Meta:\r\n database = db\r\n\r\nclas...
2022-08-14T22:10:15
2022-08-15T11:24:19
2022-08-15T11:24:18
NONE
null
I'm trying to define a base model class for all my models, so i can get type hints when i execute model.get(). This is my code ```py class BaseModel(models.Model): created_at: datetime = models.DateTimeField(default=datetime.now(tz=timezone.utc)) def get(self, *query, **filters) -> Self: return ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2604/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2604/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2603
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2603/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2603/comments
https://api.github.com/repos/coleifer/peewee/issues/2603/events
https://github.com/coleifer/peewee/pull/2603
1,331,022,867
PR_kwDOAA7yGM48xSuf
2,603
Added special expressions to boolean field
{ "login": "alteralt", "id": 109542778, "node_id": "U_kgDOBod9eg", "avatar_url": "https://avatars.githubusercontent.com/u/109542778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/alteralt", "html_url": "https://github.com/alteralt", "followers_url": "https://api.github.com/users/alteralt/...
[]
closed
false
null
[]
null
[ "Going to pass for now, thanks." ]
2022-08-07T13:52:35
2022-08-07T15:33:50
2022-08-07T15:33:50
NONE
null
Added an expression so that in the request instead of: ```python Model.select().where(Model.boolean_field == True) ```` To write: ```python Model.select().where(Model.boolean_field.is_true()) ```` The same expression already exists: https://github.com/alteralt/peewee/blob/b8c629bc100c4886c5b87b6eb62cce66c84a...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2603/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2603/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2603", "html_url": "https://github.com/coleifer/peewee/pull/2603", "diff_url": "https://github.com/coleifer/peewee/pull/2603.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2603.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2602
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2602/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2602/comments
https://api.github.com/repos/coleifer/peewee/issues/2602/events
https://github.com/coleifer/peewee/issues/2602
1,331,017,694
I_kwDOAA7yGM5PVbfe
2,602
Using `Case().alias` with join
{ "login": "cc00010", "id": 92562933, "node_id": "U_kgDOBYRl9Q", "avatar_url": "https://avatars.githubusercontent.com/u/92562933?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cc00010", "html_url": "https://github.com/cc00010", "followers_url": "https://api.github.com/users/cc00010/follow...
[]
closed
false
null
[]
null
[ "What I'm expecting is this:\r\n```json\r\n{\r\n \"attached_file\": { \"file_name\": \"test.jpg\", \"file_url\": null }\r\n}\r\n```\r\nnot this:\r\n```json\r\n{\r\n \"attached_file\": { \"file_name\": \"test.jpg\" }\r\n \"file_url\": null\r\n}\r\n```\r\n\r\nI think Peewee should automatically handle such \"calls...
2022-08-07T13:32:53
2022-08-12T13:30:38
2022-08-08T14:00:31
NONE
null
Let's say I have the following models: ```python3 class AttachedFile(Model): article = ForeignKeyField(Article) file_name = StringField() # this is public file_url = StringField() # but this field requires users to be subscribed class Article(Model): # ... attached_file = ForeignKeyField(AttachedFil...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2602/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2602/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2601
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2601/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2601/comments
https://api.github.com/repos/coleifer/peewee/issues/2601/events
https://github.com/coleifer/peewee/issues/2601
1,327,769,676
I_kwDOAA7yGM5PJChM
2,601
fn.Max Usage
{ "login": "NAN-CForadas", "id": 98823081, "node_id": "U_kgDOBePrqQ", "avatar_url": "https://avatars.githubusercontent.com/u/98823081?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NAN-CForadas", "html_url": "https://github.com/NAN-CForadas", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "```\r\nclass BaseModel(Model):\r\n class Meta:\r\n database = db\r\n```", "Please post on StackOverflow in the future. Questions like this are not appropriate to the issue tracker.\r\n\r\nDocs: http://docs.peewee-orm.com/en/latest/peewee/query_operators.html#sql-functions\r\n\r\nYour specific error is ...
2022-08-03T20:44:24
2022-08-04T00:04:01
2022-08-03T21:11:25
NONE
null
If I run this in pgsql 'SELECT Max("t1"."version") FROM "reviews" AS "t1" WHERE ("t1"."description" = 'NAN63831511');' I get: ``` psql (14.4, server 13.6) Type "help" for help. qualintel=# SELECT Max("t1"."version") FROM "reviews" AS "t1" WHERE ("t1"."description" = 'NAN63831511'); max ----- 2 (1 ro...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2601/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2601/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2600
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2600/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2600/comments
https://api.github.com/repos/coleifer/peewee/issues/2600/events
https://github.com/coleifer/peewee/issues/2600
1,322,912,657
I_kwDOAA7yGM5O2guR
2,600
How to create enum in peewee ?
{ "login": "raoehtesham79", "id": 108576451, "node_id": "U_kgDOBni-ww", "avatar_url": "https://avatars.githubusercontent.com/u/108576451?v=4", "gravatar_id": "", "url": "https://api.github.com/users/raoehtesham79", "html_url": "https://github.com/raoehtesham79", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "#630 \r\n\r\nhttps://gist.github.com/b1naryth1ef/607e92dc8c1748a06b5d", "Thanks for your response . I have seen this method . This is also not working." ]
2022-07-30T06:11:42
2022-07-30T11:56:35
2022-07-30T11:35:16
NONE
null
I am trying to create enum data type in peewee model but there is not such thing in peewee . Kindly, please help me to sort out this. Here is an example , what I want: class travel_mode(enum.Enum): Air = 1 Sea = 2 NA = 3 but how to use it in peewee model
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2600/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2600/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2599
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2599/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2599/comments
https://api.github.com/repos/coleifer/peewee/issues/2599/events
https://github.com/coleifer/peewee/issues/2599
1,318,439,007
I_kwDOAA7yGM5Olchf
2,599
How to access _database from query?
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Presumably you would know something about the database that's executing the queries, right? Or is this library restricted to operating on queries in absence of any other context? The `_database` attr is fine to use, I don't anticipate it changing any time soon.", "@coleifer \r\n\r\nI'm writing a library that is ...
2022-07-26T15:52:00
2022-07-26T17:15:45
2022-07-26T16:37:07
NONE
null
I have a library function that needs to check the information about the `db` before taking action on a query: ``` def execute_update(query): if _is_returning_supported(query._database): return _execute_returning_dml(query) return _execute_nonreturning_update(query) ``` So far the only way I...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2599/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2599/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2598
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2598/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2598/comments
https://api.github.com/repos/coleifer/peewee/issues/2598/events
https://github.com/coleifer/peewee/issues/2598
1,314,384,949
I_kwDOAA7yGM5OV-w1
2,598
Composite Foreign Key
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "You can add a constraint to the table in the following manner:\r\n\r\n```python\r\nclass Post(Model):\r\n author = TextField()\r\n title = TextField()\r\n class Meta:\r\n database = db\r\n primary_key = CompositeKey('author', 'title')\r\n\r\nclass Comment(Model):\r\n post_author = TextFie...
2022-07-22T06:15:12
2022-07-22T13:35:36
2022-07-22T13:35:36
NONE
null
The docs [state](https://www.bookstack.cn/read/peewee-orm-3.13.1-en/spilt.5.c7972b36e7689f24.md): > Peewee does not support the concept of a “composite foreign-key” I assume the reason is because it makes the ORM joins complicated. However, I simply need to create a composite foreign-key in the database in o...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2598/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2598/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2597
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2597/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2597/comments
https://api.github.com/repos/coleifer/peewee/issues/2597/events
https://github.com/coleifer/peewee/pull/2597
1,312,720,259
PR_kwDOAA7yGM4703bh
2,597
Modify the incorrect description of the document
{ "login": "sunmd01", "id": 9304859, "node_id": "MDQ6VXNlcjkzMDQ4NTk=", "avatar_url": "https://avatars.githubusercontent.com/u/9304859?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sunmd01", "html_url": "https://github.com/sunmd01", "followers_url": "https://api.github.com/users/sunmd01/...
[]
closed
false
null
[]
null
[ "I'll see about rewording this later. The docs are trying to show what the available options are, and their default values." ]
2022-07-21T06:26:54
2022-07-21T11:53:54
2022-07-21T11:53:54
NONE
null
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2597/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2597/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2597", "html_url": "https://github.com/coleifer/peewee/pull/2597", "diff_url": "https://github.com/coleifer/peewee/pull/2597.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2597.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2596
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2596/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2596/comments
https://api.github.com/repos/coleifer/peewee/issues/2596/events
https://github.com/coleifer/peewee/issues/2596
1,308,203,850
I_kwDOAA7yGM5N-ZtK
2,596
how use MATCH AGAINST
{ "login": "danil-cpu", "id": 78954394, "node_id": "MDQ6VXNlcjc4OTU0Mzk0", "avatar_url": "https://avatars.githubusercontent.com/u/78954394?v=4", "gravatar_id": "", "url": "https://api.github.com/users/danil-cpu", "html_url": "https://github.com/danil-cpu", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "You can use the helper in `playhouse.mysql_ext`:\r\n\r\n```python\r\nfrom playhouse.mysql_ext import Match\r\n\r\nmatch = Match((Script.title, Script.description), 'some word', 'with query expansion')\r\nScript.select(Script, match.alias('score'))\r\n```\r\n\r\nAlternatively, if you want to just build the expressi...
2022-07-18T16:25:20
2022-07-18T21:47:26
2022-07-18T21:46:26
NONE
null
```MySQL SELECT id, title, description, MATCH (title, description) AGAINST ('word' WITH QUERY EXPANSION) AS score FROM `script` ORDER BY score DESC``` how use query in MySQL peewee?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2596/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 2, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2596/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2595
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2595/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2595/comments
https://api.github.com/repos/coleifer/peewee/issues/2595/events
https://github.com/coleifer/peewee/issues/2595
1,307,421,644
I_kwDOAA7yGM5N7avM
2,595
Long running processes using peewee eventually fail
{ "login": "petersn", "id": 214862, "node_id": "MDQ6VXNlcjIxNDg2Mg==", "avatar_url": "https://avatars.githubusercontent.com/u/214862?v=4", "gravatar_id": "", "url": "https://api.github.com/users/petersn", "html_url": "https://github.com/petersn", "followers_url": "https://api.github.com/users/petersn/fo...
[]
closed
false
null
[]
null
[ "You need to understand how Peewee manages connections -- peewee creates a connection-per-thread and will not automatically reconnect if that connection should get closed by the server. Why? What if you were in the middle of a transaction or had uncommitted changes -- we don't want to silently lose those.\r\n\r\nSo...
2022-07-18T05:23:25
2022-07-18T13:36:56
2022-07-18T13:36:56
NONE
null
Hello folks, apologies if this issue is a duplicate. I've now seen several services I've written using peewee eventually fail after some time, varying from a few days to a couple months, with an error like: ``` Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3175, i...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2595/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2595/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2594
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2594/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2594/comments
https://api.github.com/repos/coleifer/peewee/issues/2594/events
https://github.com/coleifer/peewee/pull/2594
1,307,076,643
PR_kwDOAA7yGM47hdg4
2,594
docs: Fix a few typos
{ "login": "timgates42", "id": 47873678, "node_id": "MDQ6VXNlcjQ3ODczNjc4", "avatar_url": "https://avatars.githubusercontent.com/u/47873678?v=4", "gravatar_id": "", "url": "https://api.github.com/users/timgates42", "html_url": "https://github.com/timgates42", "followers_url": "https://api.github.com/use...
[]
closed
false
null
[]
null
[]
2022-07-17T11:59:50
2022-07-17T21:43:30
2022-07-17T21:43:30
NONE
null
There are small typos in: - docs/peewee/query_examples.rst - peewee.py - tests/model_save.py - tests/postgres_helpers.py Fixes: - Should read `hierarchy` rather than `heirarchy`. - Should read `existent` rather than `existant`. - Should read `dictionary` rather than `dictioary`. - Should read `denormalization` rather ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2594/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2594/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2594", "html_url": "https://github.com/coleifer/peewee/pull/2594", "diff_url": "https://github.com/coleifer/peewee/pull/2594.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2594.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2593
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2593/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2593/comments
https://api.github.com/repos/coleifer/peewee/issues/2593/events
https://github.com/coleifer/peewee/pull/2593
1,305,279,402
PR_kwDOAA7yGM47brpf
2,593
Run CI tests with latest stable Python version
{ "login": "pylipp", "id": 10617122, "node_id": "MDQ6VXNlcjEwNjE3MTIy", "avatar_url": "https://avatars.githubusercontent.com/u/10617122?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pylipp", "html_url": "https://github.com/pylipp", "followers_url": "https://api.github.com/users/pylipp/fo...
[]
closed
false
null
[]
null
[ "0f1a49202b72b18074032efa56e42d4aeef95cce" ]
2022-07-14T20:54:58
2022-07-15T00:10:00
2022-07-15T00:09:59
NONE
null
In order to increase confidence in the compatibility of peewee.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2593/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2593/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2593", "html_url": "https://github.com/coleifer/peewee/pull/2593", "diff_url": "https://github.com/coleifer/peewee/pull/2593.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2593.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2592
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2592/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2592/comments
https://api.github.com/repos/coleifer/peewee/issues/2592/events
https://github.com/coleifer/peewee/issues/2592
1,302,711,241
I_kwDOAA7yGM5NpcvJ
2,592
Default values for columns missing in table creation statement with sqlite
{ "login": "SandaruKasa", "id": 50824690, "node_id": "MDQ6VXNlcjUwODI0Njkw", "avatar_url": "https://avatars.githubusercontent.com/u/50824690?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SandaruKasa", "html_url": "https://github.com/SandaruKasa", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "It seems you have not read this part of the documentation: http://docs.peewee-orm.com/en/latest/peewee/models.html#default-field-values\r\n\r\n> Remember: when using the default parameter, the values are set by Peewee rather than being a part of the actual table and column definition.", "Huh, a peculiar design c...
2022-07-12T23:12:26
2022-07-13T12:50:39
2022-07-13T12:50:39
NONE
null
Python: 3.10 peewee: 3.8.2, 3.15.1 ```python import peewee import logging logging.basicConfig(level=logging.DEBUG) class Test(peewee.Model): test = peewee.IntegerField(default=1) class Meta: database = peewee.SqliteDatabase("test.sqlite3") Test.create_table() ``` gives the fo...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2592/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2592/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2591
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2591/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2591/comments
https://api.github.com/repos/coleifer/peewee/issues/2591/events
https://github.com/coleifer/peewee/issues/2591
1,302,033,145
I_kwDOAA7yGM5Nm3L5
2,591
Test test_changelog_jsonfield failing in Fedora 37
{ "login": "vkrizan", "id": 7695766, "node_id": "MDQ6VXNlcjc2OTU3NjY=", "avatar_url": "https://avatars.githubusercontent.com/u/7695766?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vkrizan", "html_url": "https://github.com/vkrizan", "followers_url": "https://api.github.com/users/vkrizan/...
[]
closed
false
null
[]
null
[ "Yes, this was fixed here: 4741e9f07d2f0fccee3a4731bc03093ef56e26f5\r\n\r\nThe regression is due to a change in the way Sqlite 3.39.0 propagates subtypes from columns in subqueries. \r\n\r\n* https://sqlite.org/src/info/\r\n* https://sqlite.org/forum/forumpost/9c94b6188e", "Is it possible to skip that single test...
2022-07-12T13:02:28
2022-07-12T13:24:35
2022-07-12T13:14:17
NONE
null
Hello, I'm building an RPM package for new Fedora 37 (rawhide) and it fails on `test_changelog_jsonfield` test. ``` FAIL: test_changelog_jsonfield (tests.sqlite_changelog.TestChangeLog.test_changelog_jsonfield) ---------------------------------------------------------------------- Traceback (most recent call las...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2591/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2591/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2590
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2590/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2590/comments
https://api.github.com/repos/coleifer/peewee/issues/2590/events
https://github.com/coleifer/peewee/pull/2590
1,300,519,555
PR_kwDOAA7yGM47Lvyk
2,590
Update variable name to match CTE
{ "login": "genchev99", "id": 40357617, "node_id": "MDQ6VXNlcjQwMzU3NjE3", "avatar_url": "https://avatars.githubusercontent.com/u/40357617?v=4", "gravatar_id": "", "url": "https://api.github.com/users/genchev99", "html_url": "https://github.com/genchev99", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "Thanks!" ]
2022-07-11T10:33:55
2022-07-11T12:01:42
2022-07-11T12:01:34
CONTRIBUTOR
null
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2590/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2590/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2590", "html_url": "https://github.com/coleifer/peewee/pull/2590", "diff_url": "https://github.com/coleifer/peewee/pull/2590.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2590.patch", "merged_at": "2022-07-11T12:01:34" }
https://api.github.com/repos/coleifer/peewee/issues/2589
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2589/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2589/comments
https://api.github.com/repos/coleifer/peewee/issues/2589/events
https://github.com/coleifer/peewee/issues/2589
1,299,968,799
I_kwDOAA7yGM5Ne_Mf
2,589
InterfaceError: connection already closed
{ "login": "Olegt0rr", "id": 25399456, "node_id": "MDQ6VXNlcjI1Mzk5NDU2", "avatar_url": "https://avatars.githubusercontent.com/u/25399456?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Olegt0rr", "html_url": "https://github.com/Olegt0rr", "followers_url": "https://api.github.com/users/Ole...
[]
closed
false
null
[]
null
[ "Since it passed this part of code as `False`\r\n```python\r\ndef cursor(self, commit=None):\r\n if self.is_closed():\r\n if self.autoconnect:\r\n self.connect()\r\n else:\r\n raise InterfaceError('Error, database connection not opened.')\r\n ...\r\n```\r\n\r\nIt seems that...
2022-07-10T17:04:03
2022-07-14T12:34:30
2022-07-11T15:40:58
NONE
null
Autoconnect is not working :( ## Code ```python from playhouse.pool import PooledPostgresqlExtDatabase database = PooledPostgresqlExtDatabase( ... autoconnect=True, ) ``` ## Traceback ```python InterfaceError: connection already closed ... File "peewee.py", line 6609, in get_or_create...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2589/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2589/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2588
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2588/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2588/comments
https://api.github.com/repos/coleifer/peewee/issues/2588/events
https://github.com/coleifer/peewee/issues/2588
1,297,840,905
I_kwDOAA7yGM5NW3sJ
2,588
Snowflake Support
{ "login": "sfc-gh-pmonteiro", "id": 82128106, "node_id": "MDQ6VXNlcjgyMTI4MTA2", "avatar_url": "https://avatars.githubusercontent.com/u/82128106?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sfc-gh-pmonteiro", "html_url": "https://github.com/sfc-gh-pmonteiro", "followers_url": "https://...
[]
closed
false
null
[]
null
[ "http://docs.peewee-orm.com/en/latest/peewee/database.html#adding-a-new-database-driver\r\n\r\nLooks like there's a driver with dbapi support so hopefully it will be rather easy.\r\n\r\nhttps://docs.snowflake.com/en/user-guide/python-connector.html" ]
2022-07-07T17:46:48
2022-07-07T17:59:24
2022-07-07T17:52:01
NONE
null
I really like this ORM but it lacks Snowflake support. I'm a python seasoned developer and willing to help Peewee support Snowflake. What is the best way to support this project? Is there any documentation on adding support to new DBs?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2588/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2588/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2587
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2587/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2587/comments
https://api.github.com/repos/coleifer/peewee/issues/2587/events
https://github.com/coleifer/peewee/issues/2587
1,297,116,231
I_kwDOAA7yGM5NUGxH
2,587
sqlite_ext / apsw bm25 search AND regex select
{ "login": "inktrap", "id": 1449471, "node_id": "MDQ6VXNlcjE0NDk0NzE=", "avatar_url": "https://avatars.githubusercontent.com/u/1449471?v=4", "gravatar_id": "", "url": "https://api.github.com/users/inktrap", "html_url": "https://github.com/inktrap", "followers_url": "https://api.github.com/users/inktrap/...
[]
closed
false
null
[]
null
[ "Facetting is typically done on the set of search results anyways, so this seems like an application for `in_`, may it be a matching regex or some attribute value that is more commonly used for facetting.\r\n\r\nI haven't looked at it in detail but I guess sqlite_ext does a phrase search (and won't tokenize my inpu...
2022-07-07T09:47:58
2022-07-11T18:50:13
2022-07-07T12:57:10
NONE
null
I would like to combine a ranked search via sqlite-ext (bm25) on a set of documents where the content matches a regexp. It is basicly a filter, not only documents that match the search *term* are returned, but those that match the *regex* **and** (then) the search term. Suppose I have this model: ``` from playho...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2587/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2587/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2586
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2586/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2586/comments
https://api.github.com/repos/coleifer/peewee/issues/2586/events
https://github.com/coleifer/peewee/issues/2586
1,295,611,195
I_kwDOAA7yGM5NOXU7
2,586
Select-query side effect
{ "login": "pylipp", "id": 10617122, "node_id": "MDQ6VXNlcjEwNjE3MTIy", "avatar_url": "https://avatars.githubusercontent.com/u/10617122?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pylipp", "html_url": "https://github.com/pylipp", "followers_url": "https://api.github.com/users/pylipp/fo...
[]
closed
false
null
[]
null
[ "When you write:\r\n\r\n`return selection or model.select()`\r\n\r\nPython needs to determine if `selection` is truth-y, so it calls its `__len__()` method to see if it's empty. This causes the query to be evaluated. The better way to do this is:\r\n\r\n`return selection if selection is not None else model.select()...
2022-07-06T10:19:50
2022-07-06T12:31:13
2022-07-06T12:31:12
NONE
null
In my application I have a function that accepts an optional `ModelSelect` argument. If it is not set, `model.select()` shall be used. The line `selection or model.select()` causes an SQL query to be executed. Why is this (side) effect? I looked at the [docs](http://docs.peewee-orm.com/en/latest/peewee/querying.html...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2586/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2586/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2585
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2585/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2585/comments
https://api.github.com/repos/coleifer/peewee/issues/2585/events
https://github.com/coleifer/peewee/pull/2585
1,292,266,047
PR_kwDOAA7yGM46wHA9
2,585
Update database.rst
{ "login": "inktrap", "id": 1449471, "node_id": "MDQ6VXNlcjE0NDk0NzE=", "avatar_url": "https://avatars.githubusercontent.com/u/1449471?v=4", "gravatar_id": "", "url": "https://api.github.com/users/inktrap", "html_url": "https://github.com/inktrap", "followers_url": "https://api.github.com/users/inktrap/...
[]
closed
false
null
[]
null
[ "Thanks, I merged a roughly equivalent patch." ]
2022-07-03T10:18:24
2022-07-11T18:49:14
2022-07-05T13:46:21
NONE
null
If the apsw **reference is rendered,** the text reads (emphasis mine): > Peewee also comes with an alternate SQLite database that uses **apsw, an advanced sqlite driver**, an advanced Python SQLite driver. I know that the idea is to describe the reference without relying on the self-description of the reference, ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2585/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2585/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2585", "html_url": "https://github.com/coleifer/peewee/pull/2585", "diff_url": "https://github.com/coleifer/peewee/pull/2585.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2585.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2584
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2584/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2584/comments
https://api.github.com/repos/coleifer/peewee/issues/2584/events
https://github.com/coleifer/peewee/issues/2584
1,285,880,995
I_kwDOAA7yGM5MpPyj
2,584
CockroachDB is not automatically setting server_version in all cases
{ "login": "arel", "id": 153497, "node_id": "MDQ6VXNlcjE1MzQ5Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/153497?v=4", "gravatar_id": "", "url": "https://api.github.com/users/arel", "html_url": "https://github.com/arel", "followers_url": "https://api.github.com/users/arel/followers", ...
[]
closed
false
null
[]
null
[ "This is now resolve, thanks for the report. In the meantime you can alternatively use the database itself as a context-manager, which ensures a connection is created and wraps the block in a transaction (assuming this is for module-scope type initialization or whatever), e.g.\r\n\r\n```python\r\nwith db:\r\n .....
2022-06-27T14:19:03
2022-06-27T17:23:59
2022-06-27T17:22:02
NONE
null
I am occasionally seeing the error message below that is not especially self-explanatory. ``` 158 def atomic(self, system_time=None, priority=None): --> 159 if self.server_version < NESTED_TX_MIN_VERSION: 160 return _crdb_atomic(self, system_time, priority) 161 return super(CockroachD...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2584/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2584/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2583
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2583/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2583/comments
https://api.github.com/repos/coleifer/peewee/issues/2583/events
https://github.com/coleifer/peewee/issues/2583
1,285,844,119
I_kwDOAA7yGM5MpGyX
2,583
Rollback doesn't work inside of Jupyter Notebook
{ "login": "NAN-CForadas", "id": 98823081, "node_id": "U_kgDOBePrqQ", "avatar_url": "https://avatars.githubusercontent.com/u/98823081?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NAN-CForadas", "html_url": "https://github.com/NAN-CForadas", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "Your error handling code looks good to me. I cannot think of what might be causing this, as it seems to be working fine on my side:\r\n\r\n![scr1656348894883](https://user-images.githubusercontent.com/119974/175994871-73e0a6a4-ebbc-4470-a085-b67210e402ae.png)\r\n\r\nIt also works when swapping `PooledPostgresDatab...
2022-06-27T13:53:27
2022-06-29T18:57:26
2022-06-27T16:56:04
NONE
null
I keep getting ```cursor.execute(sql, params or ()) psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block ``` even though I have queries inside try: except: blocks ``` def get_random_user(): with db.atomic() as txn: query_failed = Fal...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2583/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2583/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2582
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2582/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2582/comments
https://api.github.com/repos/coleifer/peewee/issues/2582/events
https://github.com/coleifer/peewee/issues/2582
1,284,912,309
I_kwDOAA7yGM5MljS1
2,582
Weird query operator behavior
{ "login": "wpnbos", "id": 33165624, "node_id": "MDQ6VXNlcjMzMTY1NjI0", "avatar_url": "https://avatars.githubusercontent.com/u/33165624?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wpnbos", "html_url": "https://github.com/wpnbos", "followers_url": "https://api.github.com/users/wpnbos/fo...
[]
closed
false
null
[]
null
[ "I have no idea what these screenshots are supposed to show. Post a self-contained, self-explanatory code snippet.", "Possibly this is to do with floating point precision. You need to use numeric / decimal field for prices.", "Confirmed this is floating point stuff.\r\n\r\n```\r\nIn [1]: from peewee import *\r\...
2022-06-26T13:21:17
2022-06-26T14:43:23
2022-06-26T13:42:24
NONE
null
<img width="482" alt="image" src="https://user-images.githubusercontent.com/33165624/175815958-5a702699-c45e-457b-9399-68daeff3c4d8.png"> <img width="476" alt="image" src="https://user-images.githubusercontent.com/33165624/175815980-dba5b463-a9c0-45d8-ae7c-f9e183621754.png"> It would seem the query operators here j...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2582/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2582/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2581
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2581/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2581/comments
https://api.github.com/repos/coleifer/peewee/issues/2581/events
https://github.com/coleifer/peewee/issues/2581
1,276,480,600
I_kwDOAA7yGM5MFYxY
2,581
Possible bug with distinct count
{ "login": "sayanarijit", "id": 11632726, "node_id": "MDQ6VXNlcjExNjMyNzI2", "avatar_url": "https://avatars.githubusercontent.com/u/11632726?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sayanarijit", "html_url": "https://github.com/sayanarijit", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "This is because Peewee wraps any query that executes a `.count()`, so the actual sql that peewee ends up executing looks like:\r\n\r\n```sql\r\n-- Post.select(Post.author_id).distinct().count()\r\nSELECT COUNT(1) FROM (\r\n SELECT DISTINCT \"t1\".\"user_id\" FROM \"tweet\" AS \"t1\"\r\n) AS \"_wrapped\"\r\n```\r\...
2022-06-20T07:18:41
2022-06-20T14:26:28
2022-06-20T14:26:05
NONE
null
I think we encountered a bug with the `.count()` method when applied on distinct column. To reproduce: ```python actual_qry = Post.select(Post.author_id).distinct() buggy_qry = Post.select(Post.author_id.distinct()) actual_qry.sql() == buggy_qry.sql() # True actual_qry.count() == buggy_qry.count() # Fal...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2581/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2581/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2580
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2580/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2580/comments
https://api.github.com/repos/coleifer/peewee/issues/2580/events
https://github.com/coleifer/peewee/issues/2580
1,275,666,732
I_kwDOAA7yGM5MCSEs
2,580
test_sqlite_isolation fails with Python 3.11
{ "login": "mgorny", "id": 110765, "node_id": "MDQ6VXNlcjExMDc2NQ==", "avatar_url": "https://avatars.githubusercontent.com/u/110765?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mgorny", "html_url": "https://github.com/mgorny", "followers_url": "https://api.github.com/users/mgorny/follow...
[]
closed
false
null
[]
null
[ "I don't see anything in the python 3.11 changelog that looks promising, any ideas?", "I'm going to try bisecting it.", "And here it is:\r\n\r\nhttps://github.com/python/cpython/commit/3df0fc89bc2714f5ef03e36a926bc795dcd5e05a\r\n\r\n```\r\ncommit 3df0fc89bc2714f5ef03e36a926bc795dcd5e05a\r\nAuthor: Erlend Egeber...
2022-06-18T05:05:45
2022-06-21T11:40:28
2022-06-20T14:45:58
NONE
null
When running tests with Python 3.11.0b3, I get the following failure: ```pytb $ python runtests.py Unable to import APSW extension tests, skipping. Unable to import CockroachDB tests, skipping. Unable to import sqlite C extension tests, skipping. Unable to import mysql-connector, skipping mysql_ext tests. Una...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2580/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2580/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2579
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2579/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2579/comments
https://api.github.com/repos/coleifer/peewee/issues/2579/events
https://github.com/coleifer/peewee/issues/2579
1,274,565,143
I_kwDOAA7yGM5L-FIX
2,579
How to return one to many records on single query
{ "login": "duc-codecomplete", "id": 45530722, "node_id": "MDQ6VXNlcjQ1NTMwNzIy", "avatar_url": "https://avatars.githubusercontent.com/u/45530722?v=4", "gravatar_id": "", "url": "https://api.github.com/users/duc-codecomplete", "html_url": "https://github.com/duc-codecomplete", "followers_url": "https://...
[]
closed
false
null
[]
null
[ "This is fundamental to how relational databases operate, I'm not sure what to tell you, it's not magic. The docs describe some approaches, however, which you may check out: http://docs.peewee-orm.com/en/latest/peewee/relationships.html#avoiding-the-n-1-problem" ]
2022-06-17T04:51:27
2022-06-17T12:53:53
2022-06-17T12:53:53
NONE
null
I have users and tweets table, 1 user has many tweets, 1 tweet belongs to an user ``` class User(BaseModel): class Meta: db_table = 'users' uuid = UUIDField(primary_key=True) email = CharField() class Tweet(BaseModel): class Meta: db_table = 'tweets' uuid = UUIDField(pr...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2579/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2579/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2578
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2578/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2578/comments
https://api.github.com/repos/coleifer/peewee/issues/2578/events
https://github.com/coleifer/peewee/issues/2578
1,270,082,911
I_kwDOAA7yGM5Ls-1f
2,578
local variable 'model_attr' referenced before assignment
{ "login": "marcpearson", "id": 17986835, "node_id": "MDQ6VXNlcjE3OTg2ODM1", "avatar_url": "https://avatars.githubusercontent.com/u/17986835?v=4", "gravatar_id": "", "url": "https://api.github.com/users/marcpearson", "html_url": "https://github.com/marcpearson", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ "I can't replicate the exception -- I agree that it looks like there may be a bug there, but I'm not sure how to trigger it. The following all work just fine:\r\n\r\n```python\r\nclass TestDjangoFilterRegression(ModelTestCase):\r\n requires = [User, Tweet]\r\n\r\n def test_django_filter_regression(self):\r\n ...
2022-06-13T23:54:07
2022-06-16T17:02:31
2022-06-16T14:17:58
NONE
null
Hi I updated my project to version 3.14.10 and receive this error. The error come from the convert_dict_to_node function. From my observation, i think the code is missing the assignation to model_attr in the for piece in key.split('__'): `def convert_dict_to_node(self, qdict): accum = [] joins =...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2578/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2578/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2577
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2577/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2577/comments
https://api.github.com/repos/coleifer/peewee/issues/2577/events
https://github.com/coleifer/peewee/issues/2577
1,268,083,091
I_kwDOAA7yGM5LlWmT
2,577
How get inserted row count from Model.insert_many() with postgres?
{ "login": "MichaelLan", "id": 9300072, "node_id": "MDQ6VXNlcjkzMDAwNzI=", "avatar_url": "https://avatars.githubusercontent.com/u/9300072?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MichaelLan", "html_url": "https://github.com/MichaelLan", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "This is a relatively recent addition:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/api.html#Insert.as_rowcount\r\n\r\n```python\r\niq = User.insert_many([(u,) for u in ('u1', 'u2', 'u3')])\r\niq = iq.returning()\r\nassert iq.as_rowcount().execute() == 3\r\n```", "I tried it, but not work, I am using postgr...
2022-06-10T22:56:28
2022-06-13T16:55:36
2022-06-11T15:52:34
NONE
null
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2577/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2577/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2576
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2576/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2576/comments
https://api.github.com/repos/coleifer/peewee/issues/2576/events
https://github.com/coleifer/peewee/pull/2576
1,263,442,200
PR_kwDOAA7yGM45QFte
2,576
Correct Model.select retreiving method in docs
{ "login": "sofienekhiari", "id": 64355269, "node_id": "MDQ6VXNlcjY0MzU1MjY5", "avatar_url": "https://avatars.githubusercontent.com/u/64355269?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sofienekhiari", "html_url": "https://github.com/sofienekhiari", "followers_url": "https://api.githu...
[]
closed
false
null
[]
null
[ "Wrong. It's correct." ]
2022-06-07T14:59:32
2022-06-07T17:58:05
2022-06-07T17:34:56
NONE
null
I believe there's a mistake in here :)
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2576/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2576/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2576", "html_url": "https://github.com/coleifer/peewee/pull/2576", "diff_url": "https://github.com/coleifer/peewee/pull/2576.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2576.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2575
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2575/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2575/comments
https://api.github.com/repos/coleifer/peewee/issues/2575/events
https://github.com/coleifer/peewee/issues/2575
1,260,945,222
I_kwDOAA7yGM5LKH9G
2,575
whether `conn` was append to PooledDatabase._connections?
{ "login": "chmberl", "id": 8245990, "node_id": "MDQ6VXNlcjgyNDU5OTA=", "avatar_url": "https://avatars.githubusercontent.com/u/8245990?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chmberl", "html_url": "https://github.com/chmberl", "followers_url": "https://api.github.com/users/chmberl/...
[]
closed
false
null
[]
null
[ "found the reason", "\r\nI made a mistake" ]
2022-06-05T02:54:19
2022-06-05T03:13:13
2022-06-05T03:11:39
NONE
null
where to `conn` append to `self._connections`? Why is _connections always empty after I set max_connections? my db url is postgresqlext+pool://xxx:xxx@localhost:5432/netket?max_connections=5&stale_timeout=300
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2575/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2575/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2574
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2574/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2574/comments
https://api.github.com/repos/coleifer/peewee/issues/2574/events
https://github.com/coleifer/peewee/issues/2574
1,260,196,814
I_kwDOAA7yGM5LHRPO
2,574
run test for MySQL 8.0 failed
{ "login": "siddontang", "id": 1080370, "node_id": "MDQ6VXNlcjEwODAzNzA=", "avatar_url": "https://avatars.githubusercontent.com/u/1080370?v=4", "gravatar_id": "", "url": "https://api.github.com/users/siddontang", "html_url": "https://github.com/siddontang", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "That's alright, we test using MariaDB." ]
2022-06-03T17:59:29
2022-06-10T13:56:04
2022-06-10T13:56:03
NONE
null
Hi, I tried to run the test for MySQL 8.0 as `python3 ./runtests.py -e mysql --mysql-user=root --mysql-port=3306`, but met some test failed, like: ``` ERROR: test_for_update_nested (tests.models.TestForUpdateIntegration) ---------------------------------------------------------------------- Traceback (most recent...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2574/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2574/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2573
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2573/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2573/comments
https://api.github.com/repos/coleifer/peewee/issues/2573/events
https://github.com/coleifer/peewee/issues/2573
1,256,166,237
I_kwDOAA7yGM5K35Nd
2,573
Question: How to make the default value of two different datetime fields match?
{ "login": "jonathanmach", "id": 12788052, "node_id": "MDQ6VXNlcjEyNzg4MDUy", "avatar_url": "https://avatars.githubusercontent.com/u/12788052?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jonathanmach", "html_url": "https://github.com/jonathanmach", "followers_url": "https://api.github.c...
[]
closed
false
null
[]
null
[ "Probably the easiest way is to override the `save()` method:\r\n\r\n```python\r\nclass BaseModel(...):\r\n def save(self, *args, **kwargs):\r\n self.updated_at = dt.now(tz)\r\n if not self.created_at: self.created_at = self.updated_at\r\n return super(BaseModel, self).save(*args, **kwargs)\...
2022-06-01T14:36:01
2022-06-08T08:28:43
2022-06-01T15:19:30
CONTRIBUTOR
null
Hi all! How to make the default value of two different datetime fields match? Say I have the following `BaseModel`: ```python class BaseModel(Model): id = CharField(primary_key=True, default=lambda: shortuuid.uuid()) created_at = DateTimeTZField(default=lambda: dt.now(tz)) updated_at = DateTimeTZ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2573/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2573/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2572
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2572/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2572/comments
https://api.github.com/repos/coleifer/peewee/issues/2572/events
https://github.com/coleifer/peewee/issues/2572
1,255,723,056
I_kwDOAA7yGM5K2NAw
2,572
The index is created with the wrong name
{ "login": "daveusa31", "id": 81916132, "node_id": "MDQ6VXNlcjgxOTE2MTMy", "avatar_url": "https://avatars.githubusercontent.com/u/81916132?v=4", "gravatar_id": "", "url": "https://api.github.com/users/daveusa31", "html_url": "https://github.com/daveusa31", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "Try this:\r\n\r\n```python\r\nclass CryptoTransaction(peewee.Model):\r\n currency = peewee.CharField(default=\"usdt\", index=True, max_length=255)\r\n hash = peewee.CharField(unique=True)\r\n\r\n class Meta:\r\n db_table = \"crypto_transaction\"\r\n database = peewee.SqliteDatabase(':memory:...
2022-06-01T11:18:54
2022-06-01T13:00:48
2022-06-01T13:00:48
NONE
null
The index is created with the wrong name ```python import peewee from playhouse.migrate import make_index_name class CryptoTransaction(peewee.Model): currency = peewee.CharField(default="usdt", index=True, max_length=255) hash = peewee.CharField(unique=True) class Meta: db_table = "c...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2572/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2572/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2571
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2571/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2571/comments
https://api.github.com/repos/coleifer/peewee/issues/2571/events
https://github.com/coleifer/peewee/issues/2571
1,253,189,231
I_kwDOAA7yGM5KsiZv
2,571
Problems using both Window() and dicts() in window functions
{ "login": "aox-lei", "id": 8756622, "node_id": "MDQ6VXNlcjg3NTY2MjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8756622?v=4", "gravatar_id": "", "url": "https://api.github.com/users/aox-lei", "html_url": "https://github.com/aox-lei", "followers_url": "https://api.github.com/users/aox-lei/...
[]
closed
false
null
[]
null
[ "Yes, aliases must be used when you want to have Python identifiers or dict keys. Peewee tries to determine the column name to use based on whatever the cursor indicates, but when you have an expression (like `SUM(\"t1\".\"value\") OVER \"w\"`) then Peewee's column-name code can't really figure out what to call it....
2022-05-30T23:36:22
2022-05-31T13:49:22
2022-05-31T13:49:22
NONE
null
version: 3.14.10 in the documentation example: http://docs.peewee-orm.com/en/latest/peewee/querying.html#reusing-window-definitions ``` win = Window(order_by=[Sample.id]) query = Sample.select( Sample.counter, Sample.value, fn.LEAD(Sample.value).over(win), fn.LAG(Sample.value).over(win), fn...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2571/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2571/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2570
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2570/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2570/comments
https://api.github.com/repos/coleifer/peewee/issues/2570/events
https://github.com/coleifer/peewee/issues/2570
1,252,991,969
I_kwDOAA7yGM5KryPh
2,570
Return dict from scalar
{ "login": "strmwalker", "id": 9069856, "node_id": "MDQ6VXNlcjkwNjk4NTY=", "avatar_url": "https://avatars.githubusercontent.com/u/9069856?v=4", "gravatar_id": "", "url": "https://api.github.com/users/strmwalker", "html_url": "https://github.com/strmwalker", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[]
2022-05-30T17:34:46
2022-05-30T17:58:52
2022-05-30T17:58:52
NONE
null
I have some analytical queries that look like this: ```python import peewee as pw query = Model.select( pw.fn.COUNT(Model.field).alias('name') ) ``` and because I am usually passing result further as dict, I have to do it like this: ```python import peewee_async manager = peewee_async.Manager() res...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2570/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2570/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2569
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2569/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2569/comments
https://api.github.com/repos/coleifer/peewee/issues/2569/events
https://github.com/coleifer/peewee/issues/2569
1,251,899,393
I_kwDOAA7yGM5KnngB
2,569
Getting Type object has no attribute _meta. on create_tables
{ "login": "Waayway", "id": 43408024, "node_id": "MDQ6VXNlcjQzNDA4MDI0", "avatar_url": "https://avatars.githubusercontent.com/u/43408024?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Waayway", "html_url": "https://github.com/Waayway", "followers_url": "https://api.github.com/users/Waaywa...
[]
closed
false
null
[]
null
[ "You're extending peewee.ModelBase for some reason: `class baseModel(peewee.ModelBase):`\r\n\r\nChange that to `class baseModel(peewee.Model)` and you'll be set.", "It now gives me a slightly different error\r\n```\r\nAttributeError: 'NoneType' object has no attribute '_meta'\r\n```", "Found the issue, i had th...
2022-05-29T14:08:04
2022-05-29T20:52:35
2022-05-29T17:13:14
NONE
null
Th error i'm getting is, `AttributeError: type object 'Chat' has no attribute '_meta'. Did you mean: 'Meta'?` Where Chat is random between the tables i'm making. My code is ``` import peewee from peewee import * from .database import db class baseModel(peewee.ModelBase): class Meta: database = db...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2569/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2569/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2568
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2568/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2568/comments
https://api.github.com/repos/coleifer/peewee/issues/2568/events
https://github.com/coleifer/peewee/issues/2568
1,250,987,691
I_kwDOAA7yGM5KkI6r
2,568
ORM traversal does not reflect updates
{ "login": "aiqc", "id": 74990642, "node_id": "MDQ6VXNlcjc0OTkwNjQy", "avatar_url": "https://avatars.githubusercontent.com/u/74990642?v=4", "gravatar_id": "", "url": "https://api.github.com/users/aiqc", "html_url": "https://github.com/aiqc", "followers_url": "https://api.github.com/users/aiqc/followers"...
[]
closed
false
null
[]
null
[ "Okay, so when I query the object directly with `select()`, it does indeed show as being updated.\r\n\r\nHowever, when accessing the object through a relationship that existed prior to the update(), the update() is not reflected. That is what was throwing me off.\r\n\r\n---\r\n\r\nThere is only 1 Label\r\n```python...
2022-05-27T16:54:45
2022-05-29T00:14:02
2022-05-29T00:14:02
NONE
null
UPDATE: see next comment below --- I am using the auto-incrementing id provided implicitly by BaseModel. `save()` is working for my `Fold` object, but not my `Label` object. I am puzzled as to why because there is nothing different about their Models. ## Models ```python from playhouse.sqlite_ext import ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2568/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2568/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2567
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2567/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2567/comments
https://api.github.com/repos/coleifer/peewee/issues/2567/events
https://github.com/coleifer/peewee/issues/2567
1,250,814,909
I_kwDOAA7yGM5Kjeu9
2,567
peewee 连接 postgresql 问题
{ "login": "MataSong", "id": 39507705, "node_id": "MDQ6VXNlcjM5NTA3NzA1", "avatar_url": "https://avatars.githubusercontent.com/u/39507705?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MataSong", "html_url": "https://github.com/MataSong", "followers_url": "https://api.github.com/users/Mat...
[]
closed
false
null
[]
null
[ "http://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata\r\n\r\n```\r\nclass BaseModel(Model):\r\n class Meta:\r\n schema = 'myschema'\r\n```" ]
2022-05-27T14:09:17
2022-05-27T14:44:10
2022-05-27T14:44:09
NONE
null
peewee 在连接 postgresql 数据库时,如何选择 schema 模式呢?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2567/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2567/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2566
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2566/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2566/comments
https://api.github.com/repos/coleifer/peewee/issues/2566/events
https://github.com/coleifer/peewee/issues/2566
1,250,777,008
I_kwDOAA7yGM5KjVew
2,566
使用peewee连接postgresql数据库
{ "login": "MataSong", "id": 39507705, "node_id": "MDQ6VXNlcjM5NTA3NzA1", "avatar_url": "https://avatars.githubusercontent.com/u/39507705?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MataSong", "html_url": "https://github.com/MataSong", "followers_url": "https://api.github.com/users/Mat...
[]
closed
false
null
[]
null
[]
2022-05-27T13:34:59
2022-05-27T14:08:08
2022-05-27T14:08:08
NONE
null
定义表名不生效。 `class PostgresCustomTableDataInfo(Model): """ custom_table_data 表 """ _id = CharField(primary_key=True) activity_id = CharField() custom_table_id = CharField() mapping_custom_table_chinese_name = CharField() data_list = ArrayField() class Mete: databa...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2566/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2566/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2565
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2565/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2565/comments
https://api.github.com/repos/coleifer/peewee/issues/2565/events
https://github.com/coleifer/peewee/issues/2565
1,249,534,666
I_kwDOAA7yGM5KemLK
2,565
pwiz doesn't find installed psycopg (peewee.ImproperlyConfigured: Postgres driver not installed!)
{ "login": "NAN-CForadas", "id": 98823081, "node_id": "U_kgDOBePrqQ", "avatar_url": "https://avatars.githubusercontent.com/u/98823081?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NAN-CForadas", "html_url": "https://github.com/NAN-CForadas", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "Sorry, I installed psycopg not psycopg2. Please excuse me!", "You probably want to use `psycopg2` or `psycopg2-binary` as those are better supported by Peewee and can coexist alongside your install of `psycopg==3`." ]
2022-05-26T12:54:28
2022-05-26T12:57:00
2022-05-26T12:56:51
NONE
null
System Software Overview: macOS Monterey System Version: macOS 12.3.1 (21E258) Kernel Version: Darwin 21.4.0 Python 3.10.4 ```% python -m pwiz -H $HOSTNAME -p 5432 -e postgresql -v $DATABASE Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/r...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2565/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2565/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2564
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2564/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2564/comments
https://api.github.com/repos/coleifer/peewee/issues/2564/events
https://github.com/coleifer/peewee/issues/2564
1,238,068,067
I_kwDOAA7yGM5Jy2tj
2,564
peewee.IntegrityError: NOT NULL constraint failed
{ "login": "umangapathak999", "id": 43605107, "node_id": "MDQ6VXNlcjQzNjA1MTA3", "avatar_url": "https://avatars.githubusercontent.com/u/43605107?v=4", "gravatar_id": "", "url": "https://api.github.com/users/umangapathak999", "html_url": "https://github.com/umangapathak999", "followers_url": "https://api...
[]
closed
false
null
[]
null
[ "SOLVED!\r\n\r\nI solved the problem. Nothing was wrong with the code. Just needed to remigrate my database. For those experiencing similar problem, script below tends to work:\r\n```\r\ndb.connect()\r\n\r\nmodels = [\r\n User\r\n]\r\n\r\ndb.drop_tables(models)\r\n\r\ndb.create_tables(models)\r\n```\r\n`db` is a...
2022-05-17T04:58:38
2022-05-17T06:54:20
2022-05-17T06:54:19
NONE
null
I want to set some fields to be nullable in User Model Here is my base model: ``` db = SqliteDatabase(DBConfig.DB_NAME) class BaseModel(Model): class Meta: database = db ``` Here is my User model: ``` class User(BaseModel): id = BigAutoField() name = CharField() email = CharFi...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2564/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2564/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2563
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2563/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2563/comments
https://api.github.com/repos/coleifer/peewee/issues/2563/events
https://github.com/coleifer/peewee/issues/2563
1,226,986,578
I_kwDOAA7yGM5JIlRS
2,563
select_extend(): allow Model parameters
{ "login": "morrissimo", "id": 782829, "node_id": "MDQ6VXNlcjc4MjgyOQ==", "avatar_url": "https://avatars.githubusercontent.com/u/782829?v=4", "gravatar_id": "", "url": "https://api.github.com/users/morrissimo", "html_url": "https://github.com/morrissimo", "followers_url": "https://api.github.com/users/m...
[]
closed
false
null
[]
null
[ "Thanks, this was an accidental omission, and is now resolved." ]
2022-05-05T17:40:24
2022-05-25T14:50:20
2022-05-25T14:49:52
NONE
null
My use case: incremental construction a query, usually via a subclass that leverages a superclass helper method. I'd like to keep the select() definition as built by the super class, but allow the subclass to extend the select targets (and JOINs, etc) _without_ having to resort to something like this: ```python c...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2563/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2563/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2562
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2562/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2562/comments
https://api.github.com/repos/coleifer/peewee/issues/2562/events
https://github.com/coleifer/peewee/issues/2562
1,217,760,621
I_kwDOAA7yGM5IlY1t
2,562
Fast way to check if record exists
{ "login": "ghost", "id": 10137, "node_id": "MDQ6VXNlcjEwMTM3", "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ghost", "html_url": "https://github.com/ghost", "followers_url": "https://api.github.com/users/ghost/followers", "f...
[]
closed
false
null
[]
null
[ "You can add an index via `sqlite3 mydb-file` and adding it there. The sqlite docs have plenty of info on creating indexes. To do it via peewee you can:\r\n\r\n* Main doc http://docs.peewee-orm.com/en/latest/peewee/models.html#indexes-and-constraints\r\n* add it to the field definition, e.g. `my_field = IntegerFiel...
2022-04-27T18:56:06
2022-04-29T15:24:34
2022-04-27T20:55:03
NONE
null
First of all I am sorry in advance for the naive question. I have an application which needs to iterate over a large number of entries and test each and every one against the sqlite peewee database to see if the value exists in a specific column. Unfortunately this means tons of queries and this turns out to be s...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2562/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2562/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2561
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2561/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2561/comments
https://api.github.com/repos/coleifer/peewee/issues/2561/events
https://github.com/coleifer/peewee/issues/2561
1,217,498,585
I_kwDOAA7yGM5IkY3Z
2,561
Count Filter is not Working
{ "login": "weaverjess", "id": 87557577, "node_id": "MDQ6VXNlcjg3NTU3NTc3", "avatar_url": "https://avatars.githubusercontent.com/u/87557577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/weaverjess", "html_url": "https://github.com/weaverjess", "followers_url": "https://api.github.com/use...
[]
closed
false
null
[]
null
[ "It's not `fn.filter()` -- you want `fn.COUNT(EventModel.id).filter(EventModel.status == 'cancelled')`\r\n\r\nThis is not a peewee issue, but rather an issue in incorrectly translating SQL to peewee APIs.", "That's exactly what I have... except it's BookingModel, not EventModel. It doesn't work. Apologies for the...
2022-04-27T15:11:13
2022-04-27T15:37:24
2022-04-27T15:17:54
NONE
null
Referencing: https://stackoverflow.com/questions/60067772/from-rows-to-columns-using-peewee-orm Event:Booking is a 1:many relationship. I have a situation where I want to pull all Events that are still bookable just to generate a list. ```python n_bookings = peewee.fn.COUNT(BookingModel.id) query = EventMode...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2561/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2561/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2560
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2560/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2560/comments
https://api.github.com/repos/coleifer/peewee/issues/2560/events
https://github.com/coleifer/peewee/issues/2560
1,213,244,589
I_kwDOAA7yGM5IUKSt
2,560
peewee.OperationalError: (1061, "Duplicate key name 'fqcmodel_date_'") ?
{ "login": "jekoie", "id": 6836400, "node_id": "MDQ6VXNlcjY4MzY0MDA=", "avatar_url": "https://avatars.githubusercontent.com/u/6836400?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jekoie", "html_url": "https://github.com/jekoie", "followers_url": "https://api.github.com/users/jekoie/foll...
[]
closed
false
null
[]
null
[ "peewee crate table in safe mode don't work at all????\r\n![image](https://user-images.githubusercontent.com/6836400/164888113-8776e544-9687-4f79-8245-fd8f7219d8da.png)\r\n", "@jekoie You are supposed to do it like this:\r\n\r\n```\r\nclass BaseModel(Model):\r\n class Meta:\r\n database = db\r\n\r\nclas...
2022-04-23T08:36:06
2022-04-25T10:52:31
2022-04-23T16:52:18
NONE
null
I use peewee create a table and connect to mysql, but it run failed? `peewee.OperationalError: (1061, "Duplicate key name 'fqcmodel_date_'")` ```python class FQCModel(Model): date_ = DateTimeField(default=datetime.datetime.now, help_text="日期", verbose_name="日期", index=True, formats="%Y-%m-%d %H:%M:%S") ```
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2560/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2560/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2559
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2559/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2559/comments
https://api.github.com/repos/coleifer/peewee/issues/2559/events
https://github.com/coleifer/peewee/issues/2559
1,208,005,244
I_kwDOAA7yGM5IALJ8
2,559
Model.create(...) possibly corrupting other items
{ "login": "peepo5", "id": 72892531, "node_id": "MDQ6VXNlcjcyODkyNTMx", "avatar_url": "https://avatars.githubusercontent.com/u/72892531?v=4", "gravatar_id": "", "url": "https://api.github.com/users/peepo5", "html_url": "https://github.com/peepo5", "followers_url": "https://api.github.com/users/peepo5/fo...
[]
closed
false
null
[]
null
[ "If you are able to write a unit-test or very small script that replicates the issue I will take a look.", "I'd suggest logging SQL and running the problematic code, then feel free to paste the resulting SQL here in this issue.\r\n\r\n```python\r\n# at top of your main python module add this\r\nimport logging\r\n...
2022-04-19T08:49:35
2022-04-20T16:01:51
2022-04-19T12:54:52
NONE
null
I have a database where I store user information. I have an API endpoint using quart (async flask) where I can submit information to be put in a database. I have a weird bug however, where for some reason when I use my discord account's data, it updates every other user's data to be the same (except for discord_id whic...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2559/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2559/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2558
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2558/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2558/comments
https://api.github.com/repos/coleifer/peewee/issues/2558/events
https://github.com/coleifer/peewee/issues/2558
1,187,379,589
I_kwDOAA7yGM5GxfmF
2,558
Index of Get Failed Row on insert_many
{ "login": "weaverjess", "id": 87557577, "node_id": "MDQ6VXNlcjg3NTU3NTc3", "avatar_url": "https://avatars.githubusercontent.com/u/87557577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/weaverjess", "html_url": "https://github.com/weaverjess", "followers_url": "https://api.github.com/use...
[]
closed
false
null
[]
null
[ "Either your db will tell you or it won't. Beyond that it's not really something peewee can figure out." ]
2022-03-31T01:54:54
2022-03-31T02:41:24
2022-03-31T02:41:24
NONE
null
Is there anyway to receive the index of a failed row on insert_many? This could be very useful for helping have feedback to users for which row in a bulk request has failed, and thus caused the whole transaction to be thrown out.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2558/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2558/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2557
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2557/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2557/comments
https://api.github.com/repos/coleifer/peewee/issues/2557/events
https://github.com/coleifer/peewee/issues/2557
1,184,153,406
I_kwDOAA7yGM5GlL8-
2,557
Sqlite Memory DB gets closed after `with db` context manager
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "In-memory databases are ephemeral and only last for the lifetime of the connection. This is by design.", "Hi @coleifer \r\n\r\nIn SQLAlchemy it doesn't behave this way. \r\n\r\nORM style:\r\n\r\n```\r\n\r\nwith Session() as session:\r\n session.execute(insert(User).values(name='foo'))\r\n session.commit()\...
2022-03-29T00:48:21
2022-03-29T18:11:22
2022-03-29T12:35:34
NONE
null
Calling `with db` on a SqliteDatabase(':memory:') will end up closing the database after the context manager exits. The code for this is [here](https://github.com/coleifer/peewee/blob/master/peewee.py#L3098). This will result in destroying the database, such that it will be a brand new database next time it is used....
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2557/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2557/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2556
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2556/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2556/comments
https://api.github.com/repos/coleifer/peewee/issues/2556/events
https://github.com/coleifer/peewee/issues/2556
1,182,588,195
I_kwDOAA7yGM5GfN0j
2,556
Insert from_select Mysql returns number of rows affected, instead of lastrowid/pk
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "\r\nUsing the pymysql driver, we can access the lastrowid for both regular inserts and insert_from style:\r\n\r\n```\r\nconn = pymysql.cononect(user='mysql', password='mysql', database='mysql')\r\ncur = conn.cursor()\r\n\r\ncur.execute(\"insert into users (name) values ('a')\")\r\nprint(cur.lastrowid)\r\n\r\ncur.e...
2022-03-27T16:38:01
2022-03-28T22:21:08
2022-03-28T00:16:40
NONE
null
Using an insert_from with mysql will always return the number of rows inserted, instead of returning the lastrowid. Postgresql instead will return a result cursor from which you can derive the lastrowid. So if we use the insert_from style with MySQL there is no way to obtain the lastrowid using the public API. In M...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2556/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2556/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2555
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2555/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2555/comments
https://api.github.com/repos/coleifer/peewee/issues/2555/events
https://github.com/coleifer/peewee/issues/2555
1,180,347,356
I_kwDOAA7yGM5GWqvc
2,555
Some issues about "(2006, "MySQL server has gone away (BrokenPipeError(32, 'Broken pipe'))"
{ "login": "czf0613", "id": 46845934, "node_id": "MDQ6VXNlcjQ2ODQ1OTM0", "avatar_url": "https://avatars.githubusercontent.com/u/46845934?v=4", "gravatar_id": "", "url": "https://api.github.com/users/czf0613", "html_url": "https://github.com/czf0613", "followers_url": "https://api.github.com/users/czf061...
[]
closed
false
null
[]
null
[ "Peewees pool and database implementation rely on connection-per-thread. This works well with regular python and gevent, but not with asyncio. Asyncio needs \"connection per asyncio context\" or behind a thread pool.", "> Peewees pool and database implementation rely on connection-per-thread. This works well with...
2022-03-25T05:01:17
2022-03-25T18:53:32
2022-03-25T11:42:10
NONE
null
I am using FastAPI as my backend framework. And I also noticed this problem solution in chatpter "framework integration", which shows: ``` python # This hook ensures that a connection is opened to handle any queries # generated by the request. @app.on_event("startup") def startup(): db.connect() # Thi...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2555/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2555/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2554
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2554/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2554/comments
https://api.github.com/repos/coleifer/peewee/issues/2554/events
https://github.com/coleifer/peewee/issues/2554
1,176,740,789
I_kwDOAA7yGM5GI6O1
2,554
Missing parametter `seen` in docstring
{ "login": "Seluj78", "id": 4641317, "node_id": "MDQ6VXNlcjQ2NDEzMTc=", "avatar_url": "https://avatars.githubusercontent.com/u/4641317?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Seluj78", "html_url": "https://github.com/Seluj78", "followers_url": "https://api.github.com/users/Seluj78/...
[]
closed
false
null
[]
null
[ "That's used internally to avoid cycles in graph when recursing. Ignore.", "Could you maybe rename it `_seen` and note it in the docstring just in case ? :) So you don't have other questions ;)" ]
2022-03-22T12:53:24
2022-03-22T12:56:19
2022-03-22T12:55:20
NONE
null
As `seen` here (lol) https://github.com/coleifer/peewee/blob/a6198b96f475a2ee9687f36eda1cbb539907c56a/playhouse/shortcuts.py#L14-L32 Cheers!
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2554/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2554/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2553
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2553/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2553/comments
https://api.github.com/repos/coleifer/peewee/issues/2553/events
https://github.com/coleifer/peewee/issues/2553
1,170,815,295
I_kwDOAA7yGM5FyTk_
2,553
Select specific columns from Model alias
{ "login": "conqp", "id": 3766192, "node_id": "MDQ6VXNlcjM3NjYxOTI=", "avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4", "gravatar_id": "", "url": "https://api.github.com/users/conqp", "html_url": "https://github.com/conqp", "followers_url": "https://api.github.com/users/conqp/follower...
[]
closed
false
null
[]
null
[ "Are you able to produce a small or concise demonstration of the issue, as you see it? Also note that it's probably a bad idea to override the `select()` method on a model class as that method is used by other functions -- better to call it something else that doesn't conflict with such a common method.", "I thin...
2022-03-16T10:21:12
2022-03-16T13:19:07
2022-03-16T13:11:51
CONTRIBUTOR
null
I have a use case where I need to join two foreign keys with the same table: ```python class Configuration(CustomerModel): """Customer configuration for charts.""" name = HTMLCharField(255) description = HTMLCharField(255, null=True) ... logo = ForeignKeyField( File, column_name='...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2553/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2553/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2552
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2552/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2552/comments
https://api.github.com/repos/coleifer/peewee/issues/2552/events
https://github.com/coleifer/peewee/issues/2552
1,167,452,061
I_kwDOAA7yGM5Fleed
2,552
Will it support async?
{ "login": "Chise1", "id": 47511274, "node_id": "MDQ6VXNlcjQ3NTExMjc0", "avatar_url": "https://avatars.githubusercontent.com/u/47511274?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Chise1", "html_url": "https://github.com/Chise1", "followers_url": "https://api.github.com/users/Chise1/fo...
[]
closed
false
null
[]
null
[]
2022-03-13T01:46:36
2022-03-13T02:29:11
2022-03-13T02:29:11
NONE
null
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2552/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2552/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2551
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2551/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2551/comments
https://api.github.com/repos/coleifer/peewee/issues/2551/events
https://github.com/coleifer/peewee/issues/2551
1,165,407,621
I_kwDOAA7yGM5FdrWF
2,551
Missing TableFunction
{ "login": "AA-Stargazer", "id": 78987858, "node_id": "MDQ6VXNlcjc4OTg3ODU4", "avatar_url": "https://avatars.githubusercontent.com/u/78987858?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AA-Stargazer", "html_url": "https://github.com/AA-Stargazer", "followers_url": "https://api.github.c...
[]
closed
false
null
[]
null
[ "I imported traceback to sqlite3_ext.py, and added \"traceback.print_exc()\" to except statement, this is what gave:\r\n File \"C:\\Users\\Enesu\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\playhouse\\sqlite_ext.py\", line 22, i...
2022-03-10T15:57:03
2022-03-10T16:51:49
2022-03-10T16:22:15
NONE
null
I'm trying to use the table function from "from playhouse.sqlite_ext import TableFunction" but it gives this error: `Traceback (most recent call last): File ".../main5.py", line 46, in <module> from playhouse.sqlite_ext import TableFunction ImportError: cannot import name 'TableFunction' from 'playhouse.sql...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2551/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2551/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2550
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2550/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2550/comments
https://api.github.com/repos/coleifer/peewee/issues/2550/events
https://github.com/coleifer/peewee/issues/2550
1,162,443,102
I_kwDOAA7yGM5FSXle
2,550
PostgreSQL with pg8000?
{ "login": "andy47", "id": 782758, "node_id": "MDQ6VXNlcjc4Mjc1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/782758?v=4", "gravatar_id": "", "url": "https://api.github.com/users/andy47", "html_url": "https://github.com/andy47", "followers_url": "https://api.github.com/users/andy47/follow...
[]
closed
false
null
[]
null
[ "I'm not familiar with pg8000, but you can consult the docs on adding a new database implementation:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/database.html#adding-a-new-database-driver", "Thanks, I'll take a look.", "Also I'm not too familiar with the new mac stuff but its probably fairly easy to comp...
2022-03-08T09:49:48
2022-03-08T21:11:48
2022-03-08T13:49:25
NONE
null
I'm developing on an Apple Silicon Mac. At the moment there isn't a way to install a binary wheel for psycopg2. So I'm looking at alternative PostgreSQL driver modules and the one that seems to work is [pg8000](https://github.com/tlocke/pg8000). Is there a way in PeeWee to substitute psycopg2 with pg8000 as the unde...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2550/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2550/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2549
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2549/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2549/comments
https://api.github.com/repos/coleifer/peewee/issues/2549/events
https://github.com/coleifer/peewee/issues/2549
1,161,684,490
I_kwDOAA7yGM5FPeYK
2,549
TestFKMigrationRegression fails with error in view notes_public: no such table: main.note
{ "login": "vkrizan", "id": 7695766, "node_id": "MDQ6VXNlcjc2OTU3NjY=", "avatar_url": "https://avatars.githubusercontent.com/u/7695766?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vkrizan", "html_url": "https://github.com/vkrizan", "followers_url": "https://api.github.com/users/vkrizan/...
[]
closed
false
null
[]
null
[ "CI is green: https://github.com/coleifer/peewee/actions/runs/1847421994\r\n\r\nHowever by reordering the tests I was able to reproduce a similar traceback. Let me put together a fix. Thanks for the report.", "Uploaded a new release, 3.14.10, which contains the fix. Thanks again.", "Thank you as well.\r\nI'm go...
2022-03-07T17:04:43
2022-03-08T09:31:43
2022-03-07T17:18:59
NONE
null
TestFKMigrationRegression test_fk_migration is failing during build in Fedora 37. https://koji.fedoraproject.org/koji/taskinfo?taskID=83790023 ``` ====================================================================== ERROR: test_fk_migration (tests.regressions.TestFKMigrationRegression) --------------------------...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2549/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2549/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2548
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2548/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2548/comments
https://api.github.com/repos/coleifer/peewee/issues/2548/events
https://github.com/coleifer/peewee/issues/2548
1,161,324,311
I_kwDOAA7yGM5FOGcX
2,548
issue inserting list of dicts as JSON binary into model
{ "login": "bgriffen", "id": 2667869, "node_id": "MDQ6VXNlcjI2Njc4Njk=", "avatar_url": "https://avatars.githubusercontent.com/u/2667869?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bgriffen", "html_url": "https://github.com/bgriffen", "followers_url": "https://api.github.com/users/bgrif...
[]
closed
false
null
[]
null
[ "I'm not sure, this is working for me:\r\n\r\n```python\r\nfrom peewee import *\r\nfrom playhouse.postgres_ext import *\r\n\r\ndb = PostgresqlExtDatabase('peewee_test')\r\n\r\nclass Reg(Model):\r\n key = CharField()\r\n value = BinaryJSONField()\r\n class Meta:\r\n database = db\r\n\r\ndb.drop_table...
2022-03-07T12:00:23
2022-03-10T14:26:14
2022-03-07T14:44:55
NONE
null
I have a simple list of dicts I want to insert into my LabelModel table in my postgres DB ```python l = [{'label': 'A', 'x': 132.56338500976562, 'y': 333.7539367675781, 'width': 183.78598022460938, 'height': 404.6580505371094, 'score': 0.9848693609237671}, {'label': 'B', 'x': 179.97842407226562,...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2548/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2548/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2547
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2547/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2547/comments
https://api.github.com/repos/coleifer/peewee/issues/2547/events
https://github.com/coleifer/peewee/issues/2547
1,161,205,220
I_kwDOAA7yGM5FNpXk
2,547
Buggy SQL syntax is produced when trying to JOIN two fields from same model
{ "login": "lapinvert", "id": 3294841, "node_id": "MDQ6VXNlcjMyOTQ4NDE=", "avatar_url": "https://avatars.githubusercontent.com/u/3294841?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lapinvert", "html_url": "https://github.com/lapinvert", "followers_url": "https://api.github.com/users/la...
[]
closed
false
null
[]
null
[ "You're almost there. Just join on the aliases themselves as opposed to .join(Parent...\r\n\r\n```\r\nDad = Adult.alias()\r\nMom = Adult.alias()\r\nquery = (\r\n Children.select(Children, Dad, Mom)\r\n .join(Dad, on=(Children.dad == Dad.id))\r\n .switch(Children)\r\n .join(Mom, on=(Children.mom == Mom.i...
2022-03-07T10:25:17
2022-03-07T14:41:25
2022-03-07T14:41:24
NONE
null
``` Adult(Model): name = CharField() Children(Model): name = CharField() dad = ForeignKeyField(Adult, backref='children_as_dad') mom = ForeignKeyField(Adult, backref='children_as_mom') Dad = Adult.alias() Mom = Adult.alias() query = ( Children.select(Children, Dad, Mom) .join(Adul...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2547/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2547/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2546
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2546/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2546/comments
https://api.github.com/repos/coleifer/peewee/issues/2546/events
https://github.com/coleifer/peewee/issues/2546
1,160,998,758
I_kwDOAA7yGM5FM29m
2,546
Alias should have a public `name` property
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Added `name` property.", "Hi @coleifer , thanks for adding these.\r\n\r\nI'm writing a library that depends on peewee.\r\n\r\nDo you think it would be sensible to simply require the new 3.14.10 version of peewee, and use the new `Alias.name`, `ModelSelect.selected_columns`, `ModelSelect.left_outer_join`, etc. di...
2022-03-07T07:17:16
2022-03-07T18:39:37
2022-03-07T14:40:17
NONE
null
I believe that the only way to check the name of an `Alias` object is to access the private `._alias` attribute. May we please add a public accessor to this? I think it should be `name`, just like the `Field` API. This is what I have to do now, which is a bit inconvenient: ``` columns = [ Tweet.id, ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2546/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2546/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2545
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2545/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2545/comments
https://api.github.com/repos/coleifer/peewee/issues/2545/events
https://github.com/coleifer/peewee/issues/2545
1,160,992,650
I_kwDOAA7yGM5FM1eK
2,545
ModelSelect public method to return list of columns in the SELECT
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Added `selected_columns` as a property." ]
2022-03-07T07:10:11
2022-03-07T14:38:53
2022-03-07T14:38:42
NONE
null
Unless I am mistaken, there is no public way to get the list of columns in the select. The only way I see is to call the private `._returning` attribute. Can we please add public access for this? SQLAlchemy has `selected_columns` in 1.3/1.4. In previous versions you could use the `.c` which returned a list of sel...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2545/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2545/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2544
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2544/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2544/comments
https://api.github.com/repos/coleifer/peewee/issues/2544/events
https://github.com/coleifer/peewee/issues/2544
1,160,753,236
I_kwDOAA7yGM5FL7BU
2,544
Peewee Is there any performance benefit to using the Query Builder over the ORM's dict/nametuple functions?
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "You'll have to profile it yourself, as it probably depends quite a bit on what types of queries you are executing. If you are really concerned about performance, using your database's python driver directly is going to be the fastest, of course. But you're using Python, so it's probably a somewhat mis-placed effor...
2022-03-06T23:52:08
2022-03-07T14:19:41
2022-03-07T14:19:41
NONE
null
I know that when the ORM returns python model objects, there is some overhead that we can eliminate by calling `.dicts()` or `.namedtuples`(). Is there any performance benefit to using the [query builder API](https://docs.peewee-orm.com/en/latest/peewee/query_builder.html) to return dicts/namedtuples, in comparison...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2544/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2544/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2543
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2543/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2543/comments
https://api.github.com/repos/coleifer/peewee/issues/2543/events
https://github.com/coleifer/peewee/issues/2543
1,160,677,687
I_kwDOAA7yGM5FLok3
2,543
Add SELECT columns to a preexisting query/ModelSelect
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Looking through the source code, I see I can do this work around by accessing a private attribute:\r\n\r\n```\r\nquery = Tweet.select(Tweet.id)\r\nquery._returning.append(Tweet.content)\r\n```\r\n\r\nBut I would rather not rely on the private attribute. ", "Nevermind, I found it:\r\n\r\n```\r\nquery = Tweet.sele...
2022-03-06T18:09:36
2022-03-06T18:24:47
2022-03-06T18:24:47
NONE
null
If I already have a preexisting Peewee query (ModelSelect), is it possible to add a column to the SELECT statement of the query? E.g: ``` query = Tweet.select(Tweet.id) # query.add_select_column(Tweet.content) # how to do this ? ``` I think it might be useful to have the `select` function of the ModelSelec...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2543/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2543/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2542
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2542/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2542/comments
https://api.github.com/repos/coleifer/peewee/issues/2542/events
https://github.com/coleifer/peewee/issues/2542
1,159,193,750
I_kwDOAA7yGM5FF-SW
2,542
filter IN is not working
{ "login": "tjengbudi", "id": 3039807, "node_id": "MDQ6VXNlcjMwMzk4MDc=", "avatar_url": "https://avatars.githubusercontent.com/u/3039807?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tjengbudi", "html_url": "https://github.com/tjengbudi", "followers_url": "https://api.github.com/users/tj...
[]
closed
false
null
[]
null
[ "You also contacted me via my personal site. Then opened an issue on GH. Please in the future use stackoverflow for basic questions like this.\r\n\r\nWorks fine, by the way:\r\n\r\n```python\r\nfrom peewee import *\r\n\r\ndb = SqliteDatabase(':memory:')\r\n\r\nclass Reg(Model):\r\n key = TextField()\r\n class...
2022-03-04T03:11:47
2022-03-04T13:24:45
2022-03-04T13:24:45
NONE
null
hello, i try to use filter IN in peewee. but the generated code is not right for example i want to select * from item where itemid in (abc, def) but the peewee is create without "()" so the peewee will create select * from item where itemid in abd, def it will raised the error in mysql. could you help me ab...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2542/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2542/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2541
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2541/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2541/comments
https://api.github.com/repos/coleifer/peewee/issues/2541/events
https://github.com/coleifer/peewee/issues/2541
1,158,194,020
I_kwDOAA7yGM5FCKNk
2,541
query error
{ "login": "wbzdssm", "id": 31335322, "node_id": "MDQ6VXNlcjMxMzM1MzIy", "avatar_url": "https://avatars.githubusercontent.com/u/31335322?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wbzdssm", "html_url": "https://github.com/wbzdssm", "followers_url": "https://api.github.com/users/wbzdss...
[]
closed
false
null
[]
null
[]
2022-03-03T09:50:45
2022-03-03T13:42:58
2022-03-03T13:42:58
NONE
null
I think I found a bug, when some fields do not exist in the model, I use the .select query to return None, but when I use scaler(as_tuple=Ture), it returns a row of correct data, I don't know if this is in line with expected; My table is not created with model, there is no table created with model, and the query ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2541/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2541/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2540
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2540/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2540/comments
https://api.github.com/repos/coleifer/peewee/issues/2540/events
https://github.com/coleifer/peewee/issues/2540
1,157,572,991
I_kwDOAA7yGM5E_yl_
2,540
.get() Raises IndexError which Results in Noisy Stack Trace
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "I'm going to pass for now." ]
2022-03-02T18:58:11
2022-03-02T19:13:59
2022-03-02T19:13:59
NONE
null
Performing `.get()` for a row that does not exist will result in a verbose stack trace that starts with an IndexError. I think it would look a bit cleaner if the IndexError did not print in the stack trace. If you agree, I would be happy to make the PR. Let me know. ``` Tweet.get(Tweet.id==0) ``` Results in:...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2540/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2540/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2539
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2539/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2539/comments
https://api.github.com/repos/coleifer/peewee/issues/2539/events
https://github.com/coleifer/peewee/issues/2539
1,157,274,927
I_kwDOAA7yGM5E-p0v
2,539
My query should return data ,but the result is sql; What should I do?
{ "login": "wbzdssm", "id": 31335322, "node_id": "MDQ6VXNlcjMxMzM1MzIy", "avatar_url": "https://avatars.githubusercontent.com/u/31335322?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wbzdssm", "html_url": "https://github.com/wbzdssm", "followers_url": "https://api.github.com/users/wbzdss...
[]
closed
false
null
[]
null
[ "Read the documentation. Follow the quickstart. Try iterating over your `query`.\r\n\r\nPost questions on stackoverflow.", "@wbzdssm When I use `scalar` it returns data.\r\n\r\nWhat is `FunctionName`, is that a table?\r\n\r\nPlease add a reproducible example.", "> FunctionName\r\n\r\nyes , it' a table; ", "@w...
2022-03-02T14:31:42
2022-03-22T11:22:19
2022-03-02T14:39:40
NONE
null
My query should return data ,but the result is sql; What should I do? sql just like: query = FunctionName.select( *query_fileds ).where( *cond ).group_by( FunctionName.appid ).scalar(as_tuple=True)
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2539/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2539/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2538
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2538/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2538/comments
https://api.github.com/repos/coleifer/peewee/issues/2538/events
https://github.com/coleifer/peewee/issues/2538
1,157,155,433
I_kwDOAA7yGM5E-Mpp
2,538
How to lazily declare a database connection?
{ "login": "jorgecarleitao", "id": 2772607, "node_id": "MDQ6VXNlcjI3NzI2MDc=", "avatar_url": "https://avatars.githubusercontent.com/u/2772607?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jorgecarleitao", "html_url": "https://github.com/jorgecarleitao", "followers_url": "https://api.gith...
[]
closed
false
null
[]
null
[ "If you had read the docs you would have found:\r\n\r\n* http://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration\r\n* http://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database\r\n* http://docs.peewee-orm.com/en/latest/peewee/database.html#setting-the...
2022-03-02T12:52:10
2022-03-02T14:33:30
2022-03-02T13:01:43
NONE
null
The idiom ```python from peewee import * db = ... class BaseModel(Model): class Meta: database = db ``` found in the guide, docs, etc. suggests that we have to either write the db credentials on the source code or read the credentials from environment on the root of the module (i.e. executed...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2538/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2538/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2537
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2537/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2537/comments
https://api.github.com/repos/coleifer/peewee/issues/2537/events
https://github.com/coleifer/peewee/pull/2537
1,155,725,918
PR_kwDOAA7yGM4zv6-R
2,537
add GitHub URL for PyPi
{ "login": "andriyor", "id": 11459840, "node_id": "MDQ6VXNlcjExNDU5ODQw", "avatar_url": "https://avatars.githubusercontent.com/u/11459840?v=4", "gravatar_id": "", "url": "https://api.github.com/users/andriyor", "html_url": "https://github.com/andriyor", "followers_url": "https://api.github.com/users/and...
[]
closed
false
null
[]
null
[]
2022-03-01T19:28:34
2022-03-01T20:10:48
2022-03-01T20:10:48
NONE
null
Warehouse now uses the project_urls provided to display links in the sidebar on [this screen](https://pypi.org/project/requests/), as well as including them in API responses to help the automation tool find the source code for Requests. Docs: [packaging.python.org/en/latest/guides/distributing-packages-using-setupto...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2537/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2537/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2537", "html_url": "https://github.com/coleifer/peewee/pull/2537", "diff_url": "https://github.com/coleifer/peewee/pull/2537.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2537.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2536
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2536/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2536/comments
https://api.github.com/repos/coleifer/peewee/issues/2536/events
https://github.com/coleifer/peewee/issues/2536
1,153,904,574
I_kwDOAA7yGM5Exy--
2,536
bulk_update for datetime fail
{ "login": "LLjiahai", "id": 30220658, "node_id": "MDQ6VXNlcjMwMjIwNjU4", "avatar_url": "https://avatars.githubusercontent.com/u/30220658?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LLjiahai", "html_url": "https://github.com/LLjiahai", "followers_url": "https://api.github.com/users/LLj...
[]
closed
false
null
[]
null
[ "Im always surprised people can take the time to open the issue and then completely fail to explain their actual issue.", "oh my god stupid thing to do,When I try to use \"bulk_update\" function update mysql_db datetime field, it doesn't take effect", "It works fine for me:\r\n\r\n```python\r\nclass Reg(Model):...
2022-02-28T10:17:13
2022-02-28T14:30:43
2022-02-28T12:42:03
NONE
null
![aaa](https://user-images.githubusercontent.com/30220658/155965562-7511c03e-5de1-4df0-91b1-805303546976.png)
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2536/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2536/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2535
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2535/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2535/comments
https://api.github.com/repos/coleifer/peewee/issues/2535/events
https://github.com/coleifer/peewee/issues/2535
1,150,740,149
I_kwDOAA7yGM5Elua1
2,535
Flask-Admin Peewee Contribution Issue
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "This belongs on the flask-admin repo.", "@coleifer Thanks, I will add it there. Would you be able to comment on this part:\r\n\r\nWould there be any harm to wrapping calls from inside of flask-admin with code that opens/closes a connection, if the user is opening a connection from `app.before_request`?\r\n\r\nE....
2022-02-25T18:35:30
2022-02-25T18:52:18
2022-02-25T18:48:08
NONE
null
Sorry if this is the wrong repo to put this in, I wasn't sure if creating this issue in flask-admin made sense. The Peewee contribution to Flask-Admin assumes that a connection to the database has already been opened in `app.before_request`. If a connection has not been opened in `app.before_request`, and the db's ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2535/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2535/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2534
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2534/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2534/comments
https://api.github.com/repos/coleifer/peewee/issues/2534/events
https://github.com/coleifer/peewee/issues/2534
1,149,020,930
I_kwDOAA7yGM5EfKsC
2,534
Accept NoneType value as a default; Verify arguments while initializing the model object
{ "login": "hung3a8", "id": 52038546, "node_id": "MDQ6VXNlcjUyMDM4NTQ2", "avatar_url": "https://avatars.githubusercontent.com/u/52038546?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hung3a8", "html_url": "https://github.com/hung3a8", "followers_url": "https://api.github.com/users/hung3a...
[]
closed
false
null
[]
null
[ "The first issue -- sorry this is not something I intend to change. Just write a wrapper or a classmethod constructor that does the validation if you want.\r\n\r\n>In peewee.Metadata.add_field, fields with default=None are passed, and their values are set to the pythonic default values (not sure how to call it) lik...
2022-02-24T08:54:48
2022-02-25T01:11:09
2022-02-25T01:11:09
NONE
null
In [`peewee.Model.__init__`](https://github.com/coleifer/peewee/blob/528e014c640e0743c7a34069ca31754d79cc3de5/peewee.py#L6321), we set the values for the fields like this: ```python for k in kwargs: setattr(self, k, kwargs[k]) ``` Let's say I am working on a `User` model with some fields like `...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2534/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2534/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2533
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2533/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2533/comments
https://api.github.com/repos/coleifer/peewee/issues/2533/events
https://github.com/coleifer/peewee/issues/2533
1,147,602,268
I_kwDOAA7yGM5EZwVc
2,533
Add and_, or_ functions ?
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Peewee doesn't need these - you can just `from operator import or_` and use that directly." ]
2022-02-23T03:58:24
2022-02-23T14:04:41
2022-02-23T14:04:41
NONE
null
Would you consider adding a public `and_` and `or_` function to peewee? SQLAlchemy has this which helps readability, compared to the bitwise operators. ``` User.select().join( Tweet, JOIN.OUTER_JOIN, on=(Tweet.user == User.id) ).where( User.id == 123, or_( Tweet.id.is_null(), ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2533/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2533/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2532
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2532/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2532/comments
https://api.github.com/repos/coleifer/peewee/issues/2532/events
https://github.com/coleifer/peewee/pull/2532
1,147,261,095
PR_kwDOAA7yGM4zTbiL
2,532
Add better support for left_outer_join convenience function
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Thanks, looks good!" ]
2022-02-22T18:56:37
2022-02-23T14:23:29
2022-02-23T14:23:19
NONE
null
The `Source` class has a `left_outer_join` convenience function which calls `join`. However, unlike `join`, the `left_outer_join` function is not overridden in `Select` and `ModelSelect`. Currently, this means that doing `User.select().left_outer_join(Tweet)` returns a `Join` object, not a `ModelSelect`. This is...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2532/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2532/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2532", "html_url": "https://github.com/coleifer/peewee/pull/2532", "diff_url": "https://github.com/coleifer/peewee/pull/2532.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2532.patch", "merged_at": "2022-02-23T14:23:19" }
https://api.github.com/repos/coleifer/peewee/issues/2531
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2531/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2531/comments
https://api.github.com/repos/coleifer/peewee/issues/2531/events
https://github.com/coleifer/peewee/issues/2531
1,146,962,375
I_kwDOAA7yGM5EXUHH
2,531
How contribute to project ?
{ "login": "ParfaitD9", "id": 79906637, "node_id": "MDQ6VXNlcjc5OTA2NjM3", "avatar_url": "https://avatars.githubusercontent.com/u/79906637?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ParfaitD9", "html_url": "https://github.com/ParfaitD9", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "#peewee on libera.chat (IRC) is probably the best place, but it's fairly quiet and mostly used for helping answer questions or troubleshooting issues. To contribute you just need the following:\r\n\r\n* have an idea for how to improve the library\r\n* implement it (optionally checking here to see if the improvemen...
2022-02-22T14:11:34
2022-02-22T16:35:19
2022-02-22T14:20:16
NONE
null
I just want to know how to contribute to the project. I'm very interested.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2531/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2531/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2530
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2530/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2530/comments
https://api.github.com/repos/coleifer/peewee/issues/2530/events
https://github.com/coleifer/peewee/issues/2530
1,146,059,384
I_kwDOAA7yGM5ET3p4
2,530
Memory Caching Question
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "So peewee select queries are not executed until iterated over (although explicitly calling `execute()` on a Select query *will* execute it, returning a cursor wrapper, but that's kinda beside the point).\r\n\r\nHowever, this code *only* issues and executes a single query:\r\n\r\n```python\r\nquery = Tweet.select()...
2022-02-21T17:20:50
2022-02-21T19:23:17
2022-02-21T18:43:32
NONE
null
Not a bug, just a question. In the documentation it states the following: > Subsequent iterations of the same query will not hit the database as the results are cached. To disable this behavior (to reduce memory usage), call Select.iterator() when iterating. I'm not clear in what circumstances I would want to ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2530/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2530/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2529
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2529/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2529/comments
https://api.github.com/repos/coleifer/peewee/issues/2529/events
https://github.com/coleifer/peewee/pull/2529
1,145,289,456
PR_kwDOAA7yGM4zM9J-
2,529
Fix count_queries to prevent couting pool events as queries.
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Thanks, merged an equivalent patch.", "Thanks. Is there any way to get the query execution time?\r\n\r\nOne of the nice things about django is that `connection.queries` stores the execution time of the query, so for example you can log all queries that take longer than 2 seconds:\r\n\r\n from django.db import...
2022-02-21T03:58:43
2022-02-21T18:34:52
2022-02-21T13:25:52
NONE
null
When using the `count_queries()` function from the `playhouse.test_utils`, it does not give the expected count when you use a Pool. It includes things like opening a connection or returning the connection to the pool as a query. The solution is to simply include log records from "peewee" not from "peewee.pool". I've...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2529/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2529/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2529", "html_url": "https://github.com/coleifer/peewee/pull/2529", "diff_url": "https://github.com/coleifer/peewee/pull/2529.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2529.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2528
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2528/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2528/comments
https://api.github.com/repos/coleifer/peewee/issues/2528/events
https://github.com/coleifer/peewee/pull/2528
1,143,396,343
PR_kwDOAA7yGM4zGgQQ
2,528
Add support for conditionally inserting a single row.
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "I'm going to pass for now, thanks.", "Hi @coleifer would you have another suggestion for being able to accomplish the insert myself?\r\n\r\nI came up with this but do not like it. Is there a better way?\r\n\r\n```\r\nTweet.insert_from(\r\n peewee.Select(\r\n columns=['my_tweet', user, datetime.now()] ...
2022-02-18T16:51:20
2022-07-27T03:31:55
2022-02-18T19:21:23
NONE
null
Hello, This PR enables conditional insertion of a single row, with default values automatically provided, in a single trip to the database. Would you be willing to support this syntactic sugar? In this example, we are conditionally inserting a Tweet, so long as the User has not already tweeted in the last hour...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2528/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2528/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2528", "html_url": "https://github.com/coleifer/peewee/pull/2528", "diff_url": "https://github.com/coleifer/peewee/pull/2528.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2528.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2527
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2527/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2527/comments
https://api.github.com/repos/coleifer/peewee/issues/2527/events
https://github.com/coleifer/peewee/issues/2527
1,139,014,641
I_kwDOAA7yGM5D4_vx
2,527
Child Table's FK is set to None only if Joining to Parent and Selecting Column from Parent
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Also, the `.dicts()` and `.objects()` work fine and return the correct non-None value:\r\n\r\n.objects() is fine:\r\n\r\n```\r\nbar = list(\r\n Bar.select(\r\n Bar.foo_id,\r\n Foo.name,\r\n ).join(\r\n Foo, on=(Bar.foo_id == Foo.id)\r\n ).objects()\r\n)[0]\r\n\r\nassert bar.foo_id == ...
2022-02-15T17:42:32
2022-02-18T19:20:40
2022-02-16T17:57:32
NONE
null
A child table's foreign key is set to None when you do both of the following: 1) join it to the parent table 2) and when you select a non-pk column from the parent table (as opposed to the entire parent table or selecting just the pk column) If you join to the parent table but select no column from the parent t...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2527/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2527/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2526
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2526/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2526/comments
https://api.github.com/repos/coleifer/peewee/issues/2526/events
https://github.com/coleifer/peewee/issues/2526
1,138,042,299
I_kwDOAA7yGM5D1SW7
2,526
Does using `with db:` in a context manager open the database and start a transaction?
{ "login": "mkmoisen", "id": 2534631, "node_id": "MDQ6VXNlcjI1MzQ2MzE=", "avatar_url": "https://avatars.githubusercontent.com/u/2534631?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mkmoisen", "html_url": "https://github.com/mkmoisen", "followers_url": "https://api.github.com/users/mkmoi...
[]
closed
false
null
[]
null
[ "Correct. Doc:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/api.html#Database.__enter__\r\n\r\nIf you just want to do the open/close without the tx, you can:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/api.html#Database.connection_context", "Hi @coleifer , thank you. Is the following statement correc...
2022-02-15T01:03:44
2023-02-12T05:01:23
2022-02-15T12:52:59
NONE
null
Not a bug, just question. The `Database` class has the following code: ``` def __enter__(self): if self.is_closed(): self.connect() ctx = self.atomic() self._state.ctx.append(ctx) ctx.__enter__() return self def __exit__(self, exc_type, exc_val...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2526/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2526/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2525
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2525/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2525/comments
https://api.github.com/repos/coleifer/peewee/issues/2525/events
https://github.com/coleifer/peewee/issues/2525
1,135,609,272
I_kwDOAA7yGM5DsAW4
2,525
RecursionError: maximum recursion depth exceeded while calling a Python object
{ "login": "tekumara", "id": 125105, "node_id": "MDQ6VXNlcjEyNTEwNQ==", "avatar_url": "https://avatars.githubusercontent.com/u/125105?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tekumara", "html_url": "https://github.com/tekumara", "followers_url": "https://api.github.com/users/tekumar...
[]
closed
false
null
[]
null
[ "Can you please share the schema (which can be dumped from the sqlite3 utility)?\r\n\r\n```\r\necho \".schema\" | sqlite3 my_db.db > schema.sql\r\n```\r\n\r\nI didn't believe it was possible to have circular foreign-key dependencies with Sqlite, so I'm not sure how to replicate this.", "```\r\nCREATE TABLE flow_r...
2022-02-13T10:22:15
2022-02-16T01:46:06
2022-02-14T12:26:36
NONE
null
When two tables have foreign keys that reference each other: ``` Traceback (most recent call last): File "/Users/tekumara/.local/bin/sqlite_web", line 8, in <module> sys.exit(main()) File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/sqlite_web/sqlite_web.py", line 841, in mai...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2525/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2525/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2524
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2524/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2524/comments
https://api.github.com/repos/coleifer/peewee/issues/2524/events
https://github.com/coleifer/peewee/issues/2524
1,128,316,262
I_kwDOAA7yGM5DQL1m
2,524
Default rule is not being applied in SQL
{ "login": "AnitaErnszt", "id": 56001200, "node_id": "MDQ6VXNlcjU2MDAxMjAw", "avatar_url": "https://avatars.githubusercontent.com/u/56001200?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AnitaErnszt", "html_url": "https://github.com/AnitaErnszt", "followers_url": "https://api.github.com/...
[]
closed
false
null
[]
null
[ ">I need to make sure these default rules are also applied in SQL.\r\n\r\nThat's done by adding an explicit constraint:\r\n\r\n```python\r\ndefault_0 = IntegerField(constraints=[SQL('default 0')])\r\n```\r\n\r\nPlease consult the docs. I don't write them for fun.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/m...
2022-02-09T10:04:11
2022-02-09T14:17:00
2022-02-09T14:17:00
NONE
null
When creating new table the default constraints are not applied in SQL. Example: ``` class Test(BaseModel): not_nullable = CharField() unique = CharField(null=True, unique=True) default_true = BooleanField(default=True) default_0 = IntegerField(default=0) ``` If I run print_table_sql(Test) ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2524/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2524/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2523
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2523/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2523/comments
https://api.github.com/repos/coleifer/peewee/issues/2523/events
https://github.com/coleifer/peewee/issues/2523
1,124,194,538
I_kwDOAA7yGM5DAdjq
2,523
Transaction not working with migrate
{ "login": "BobBDE", "id": 16068649, "node_id": "MDQ6VXNlcjE2MDY4NjQ5", "avatar_url": "https://avatars.githubusercontent.com/u/16068649?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BobBDE", "html_url": "https://github.com/BobBDE", "followers_url": "https://api.github.com/users/BobBDE/fo...
[]
closed
false
null
[]
null
[ "Are you using MySQL? It's quite possible your database does not support transaction DDL.", "Transactions are working fine with the migrator generally, I assume this is down to your database not supporting it:\r\n\r\n```python\r\nclass Reg(Model):\r\n key = TextField()\r\n class Meta:\r\n database = ...
2022-02-04T13:16:52
2022-02-08T13:10:30
2022-02-04T14:28:51
NONE
null
Hello, I have a problem with the peewee migration. I can't make transactions work with the migrate. It is always committed, I can't rollback. It should be possible as the documentation says in the warning section here: https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#example-usage Here is an exemple...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2523/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2523/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2522
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2522/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2522/comments
https://api.github.com/repos/coleifer/peewee/issues/2522/events
https://github.com/coleifer/peewee/issues/2522
1,122,956,949
I_kwDOAA7yGM5C7vaV
2,522
Temporary Database in SQLite
{ "login": "RAbraham", "id": 214189, "node_id": "MDQ6VXNlcjIxNDE4OQ==", "avatar_url": "https://avatars.githubusercontent.com/u/214189?v=4", "gravatar_id": "", "url": "https://api.github.com/users/RAbraham", "html_url": "https://github.com/RAbraham", "followers_url": "https://api.github.com/users/RAbraha...
[]
closed
false
null
[]
null
[ "Peewee has excellent documentation, here:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/index.html\r\n\r\nI suggest searching that for the string ':memory:', for example. ", "`SqliteDatabase(':memory:')`", "Hi,\r\nThanks for your quick response.\r\nI think what I want may not be satisfied by the ':memory' config...
2022-02-03T11:15:15
2022-02-07T20:34:58
2022-02-03T12:21:02
NONE
null
Hi, How do I create a temporary SQLite database[1] using `peewee`? In Python, I would normally create it like this with an empty string ```python import sqlite3 db = sqlite3.connect("") ``` [1] - Section 'Temporary Databases' at https://www.sqlite.org/inmemorydb.html
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2522/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2522/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2521
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2521/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2521/comments
https://api.github.com/repos/coleifer/peewee/issues/2521/events
https://github.com/coleifer/peewee/pull/2521
1,118,448,106
PR_kwDOAA7yGM4xybeb
2,521
Added optional use_column_names instead of field names in model_to_dict
{ "login": "deduble", "id": 32467847, "node_id": "MDQ6VXNlcjMyNDY3ODQ3", "avatar_url": "https://avatars.githubusercontent.com/u/32467847?v=4", "gravatar_id": "", "url": "https://api.github.com/users/deduble", "html_url": "https://github.com/deduble", "followers_url": "https://api.github.com/users/dedubl...
[]
closed
false
null
[]
null
[ "I'll pass on this, thanks." ]
2022-01-30T07:52:37
2022-01-30T14:51:17
2022-01-30T14:51:17
NONE
null
I am using this in model_to_dict in jobs because it makes the created python object keys consistent with the database column names when communicating through web apps. Despite column names are not case sensitive when querying, language mediums are, so it goes hand in hand with pwiz db_model.py tool. I didn't know what ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2521/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2521/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2521", "html_url": "https://github.com/coleifer/peewee/pull/2521", "diff_url": "https://github.com/coleifer/peewee/pull/2521.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2521.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2520
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2520/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2520/comments
https://api.github.com/repos/coleifer/peewee/issues/2520/events
https://github.com/coleifer/peewee/issues/2520
1,116,972,546
I_kwDOAA7yGM5Ck6YC
2,520
[Question] How to select row with most recent date per user?
{ "login": "loynoir", "id": 78727408, "node_id": "MDQ6VXNlcjc4NzI3NDA4", "avatar_url": "https://avatars.githubusercontent.com/u/78727408?v=4", "gravatar_id": "", "url": "https://api.github.com/users/loynoir", "html_url": "https://github.com/loynoir", "followers_url": "https://api.github.com/users/loynoi...
[]
closed
false
null
[]
null
[ "Post your questions on stackoverflow or irc. This is the issue tracker." ]
2022-01-28T03:51:37
2022-01-28T13:50:40
2022-01-28T13:50:40
NONE
null
### Question Hi, sir. What's the peewee way, to select row with most recent date per user? ### Input id | user | val -- | -- | -- 1 | jane | 11 2 | john | 21 3 | bob | 32 4 | bob | 31 5 | john | 22 ### Output id | user | val -- | -- | -- 1 | jane | 11 4 | bob | 31 5 | john | 22 <details>...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2520/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2520/timeline
null
completed
null
null