from fastlite import *
core
Proposal to improve fastlite dataclass automatic naming scheme
= database(":memory:") db
"CREATE TABLE table_with_underscores (ID INTEGER)") db.q(
[]
db.t
table_with_underscores
Underscores
Notice that underscores are not handled properly:
= db.t.table_with_underscores.dataclass()
a a
fastlite.core.Table_With_Underscores
a()
Table_With_Underscores(ID=UNSET)
Plurals
I would like to have a table named users
, but dataclasses named User
. How would I achive that?
"CREATE TABLE users (ID INTEGER)") db.q(
[]
db.t
table_with_underscores, users
= db.t.users.dataclass()
u u
fastlite.core.Users
u()
Users(ID=UNSET)