Naming of columns
See original GitHub issueDiscussed in https://github.com/piccolo-orm/piccolo/discussions/206
Allow Table
columns to map to database columns with different names.
For example:
class MyTable(Table):
name = Varchar(name="person_name")
In the example above, when doing queries, you will use MyTable.name
, but the actual column in the database is called person_name
.
This is useful when using Piccolo on legacy databases with non-ideal column names.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Database, Table and Column Naming Conventions
Step-1 : Each column name should be unique. If two columns from different tables serving different purposes are in the same database then...
Read more >How to Give a Name to the Columns in Excel
1. Click the letter of the column you want to rename to highlight the entire column. ; 2. Click the "Name" box, located...
Read more >Learn SQL: Naming Conventions - SQLShack
A naming convention is a set of unwritten rules you should use if you want to increase the readability of the whole data...
Read more >SQL Naming Conventions (2023 Tutorial & Examples)
Use all lowercase for column and table names and to separate words with an underscore (“_”). For example, start_date and end_date as column...
Read more >Rules for name column definitions - IBM
Column names can be up to 255 characters long. · They must begin with an alphabetic character, $ or underscore, and can contain...
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 Free
Top 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
Just installed the new version. Works perfectly. Thnx.
There’s also this approach for anyone coming across this in the future:
https://github.com/piccolo-orm/piccolo/blob/69389132d5946ea29f98a763d015afe49fbc5b86/piccolo/table.py#L955
So it’s:
A bit harder to read, but useful in a pinch.