sqllex icon indicating copy to clipboard operation
sqllex copied to clipboard

FEATURE | SQLite3x.path, relative vs absolute

Open v1a0 opened this issue 4 years ago • 2 comments

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'

v1a0 avatar Sep 18 '21 06:09 v1a0

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

Phizilion avatar Sep 18 '21 07:09 Phizilion

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

v1a0 avatar Sep 18 '21 16:09 v1a0