v1a0 / sqllex

The most pythonic ORM (for SQLite and PostgreSQL). Seriously, try it out!
https://v1a0.github.io/sqllex
GNU General Public License v3.0
91 stars 8 forks source link

FEATURE | SQLite3x.path, relative vs absolute #45

Open v1a0 opened 3 years ago

v1a0 commented 3 years ago

SQLite3x.path returns relative path, but I guess return absolute path it's more reasonable for this property.

Now

db.path # 'my_db.db'

Will be

db.path # '/usr/local/.../my_project/my_db.db'
Phizilion commented 3 years ago

But does it make sense to return the path at all if this argument is not required when creating an object?

v1a0 commented 3 years ago

But does it make sense to return the path at all if this argument is not required when creating an object?

Yep, sure it is. It's one of the most important properties of SQLite database. There might be many cases when you need to know with witch database you interacting (especially in some universal scripts) and there is the way to check it.

And it is required, this is the first argument of class at all

db = SQLite3x(
    path='my_database.db',
)

wiki SQLite3x wiki SQLite3x.path