Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
465 B

  1. #!/usr/bin/env python3
  2. import os
  3. import sqlite3
  4. os.chdir(os.path.join(os.getenv('HOME'), 'notes'))
  5. conn = sqlite3.connect('metadata.db')
  6. c = conn.cursor()
  7. c.execute(
  8. '''CREATE TABLE links (
  9. page text,
  10. target text,
  11. UNIQUE(page, target)
  12. );
  13. '''
  14. )
  15. c.execute(
  16. '''CREATE TABLE pages (
  17. page text,
  18. title text,
  19. datetime text,
  20. UNIQUE(page)
  21. );
  22. '''
  23. )
  24. conn.commit()
  25. conn.close()