social media crossposting tool. 3rd time's the charm
mastodon
misskey
crossposting
bluesky
1from pathlib import Path
2import sqlite3
3
4def get_conn(db: Path) -> sqlite3.Connection:
5 conn = sqlite3.connect(db, autocommit=True, check_same_thread=False)
6 conn.row_factory = sqlite3.Row
7 _ = conn.executescript("""
8 PRAGMA journal_mode = WAL;
9 PRAGMA mmap_size = 134217728;
10 PRAGMA cache_size = 4000;
11 PRAGMA synchronous = NORMAL;
12 PRAGMA foreign_keys = ON;
13 """)
14 return conn