mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 01:44:31 +02:00
table.count property, plus made a start on table documentation
This commit is contained in:
parent
0d63128c40
commit
b69f8b6c85
4 changed files with 80 additions and 1 deletions
|
|
@ -71,6 +71,12 @@ class Table:
|
|||
self.name = name
|
||||
self.exists = self.name in self.db.tables
|
||||
|
||||
@property
|
||||
def count(self):
|
||||
return self.db.conn.execute(
|
||||
"select count(*) from [{}]".format(self.name)
|
||||
).fetchone()[0]
|
||||
|
||||
@property
|
||||
def columns(self):
|
||||
if not self.exists:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue