Extra `t2` while generating query
See original GitHub issueModel
class MsgLog(Model):
master_msg_id = CharField(unique=True, primary_key=True)
text = CharField()
slave_origin_uid = CharField()
slave_origin_display_name = CharField(null=True)
slave_member_uid = CharField(null=True)
slave_member_display_name = CharField(null=True)
msg_type = CharField()
sent_to = CharField()
class Meta:
database = SqliteDatabase('data.db')
Query
chat_id = 1
q = MsgLog.select().where(MsgLog.master_msg_id.startswith("%s." % chat_id)).order_by(MsgLog.id.desc())
print(q)
Expected result
SELECT "t1"."master_msg_id", "t1"."text", "t1"."slave_origin_uid", "t1"."slave_origin_display_name", "t1"."slave_member_uid", "t1"."slave_member_display_name", "t1"."msg_type", "t1"."sent_to" FROM "msglog" AS t1 WHERE ("t1"."master_msg_id" LIKE ?) ORDER BY "t1"."id" DESC ['1.%']
Returned result
SELECT "t1"."master_msg_id", "t1"."text", "t1"."slave_origin_uid", "t1"."slave_origin_display_name", "t1"."slave_member_uid", "t1"."slave_member_display_name", "t1"."msg_type", "t1"."sent_to" FROM "msglog" AS t1 WHERE ("t1"."master_msg_id" LIKE ?) ORDER BY "t2"."id" DESC ['1.%']
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
sql - Adding extra column to view, which is not present in table
CREATE OR REPLACE VIEW DETAILS AS SELECT * FROM ( SELECT T1.ID, T1.AMOUNT, T1.STATUS, T1.ADDEDBY, T1.ADDEDON FROM Table1 T1 UNION ALL SELECT T2....
Read more >5 Query Transformations
The database can execute the preceding query by joining departments and locations to generate the rows of the view, and then joining this...
Read more >Documentation: 15: 14.1. Using EXPLAIN - PostgreSQL
You can use the EXPLAIN command to see what query plan the planner creates ... of caching that's expected to occur during the...
Read more >Optimising SELECTs and Other Queries - MySQL ... - O'Reilly
If so, create an appropriate index and check the query with EXPLAIN again. ... In this case MySQL will scan t1 and look...
Read more >MySQL 8.0 Reference Manual :: 8.8.2 EXPLAIN Output Format
The EXPLAIN statement provides information about how MySQL executes statements. EXPLAIN works with SELECT , DELETE , INSERT , REPLACE , and UPDATE ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reopening as I intend to fix.
The truth is that I removed your comments because they were not constructive, and I was tired of having to defend aspects of my project because you felt entitled to a technical discussion because you happened to disagree with it. When I pointed to you that the things you disagreed with were documented and obviously intentional (via git log), you suggested I was trying to justify, post-hoc, bad design decisions, and was being an irresponsible maintainer. How is that constructive?