from fastlite import *core
Proposal to improve fastlite dataclass automatic naming scheme
db = database(":memory:")db.q("CREATE TABLE table_with_underscores (ID INTEGER)")[]
db.ttable_with_underscores
Underscores
Notice that underscores are not handled properly:
a = db.t.table_with_underscores.dataclass()
afastlite.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?
db.q("CREATE TABLE users (ID INTEGER)")[]
db.ttable_with_underscores, users
u = db.t.users.dataclass()
ufastlite.core.Users
u()Users(ID=UNSET)