开发者

SQLite table creation date

开发者 https://www.devze.com 2022-12-30 21:31 出处:网络
Is th开发者_如何学JAVAere a way to query the creation date of a table in SQLite? I am new to SQL, overall. I just found this SQL Server table creation date query.

Is th开发者_如何学JAVAere a way to query the creation date of a table in SQLite? I am new to SQL, overall. I just found this SQL Server table creation date query. I am assuming that sqlite_master is the equivalent to sys.tables in SQLite. Is that correct? But then my sqlite_master table only has the columns "type", "name", "tbl_name", "rootpage" and "sql". If this is not possible in SQLite, what would be the best way to implement this functionality by myself?


SQLite does not store this data itself. Like you said, the sqlite_master table doesn't have any relevant column.

There's no particularly nice way that I can come up with to implement it. You could create some sort of interface for creating tables, and have it note the time whenever you create a new one, but anything created through a different method won't go through the same process. It also looks like there's no way to set a trigger on CREATE TABLE, so that's not an option either.

Why do you want this functionality? Creating tables seems like something you wouldn't be doing very often, maybe there's a better way to approach the problem?

0

精彩评论

暂无评论...
验证码 换一张
取 消