core

Proposal to improve fastlite dataclass automatic naming scheme
from fastlite import *
db = database(":memory:")
db.q("CREATE TABLE table_with_underscores (ID INTEGER)")
[]
db.t
table_with_underscores

Underscores

Notice that underscores are not handled properly:

a = db.t.table_with_underscores.dataclass()
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?

db.q("CREATE TABLE users (ID INTEGER)")
[]
db.t
table_with_underscores, users
u = db.t.users.dataclass()
u
fastlite.core.Users
u()
Users(ID=UNSET)