16 lines
		
	
	
	
		
			373 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			373 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from peewee import Model
 | |
| from playhouse.sqlite_ext import SqliteExtDatabase
 | |
| 
 | |
| db = SqliteExtDatabase(
 | |
|     "openstates.db",
 | |
|     pragmas=(
 | |
|         ("cache_size", 1024 * 64),  # 64MB page-cache.
 | |
|         ("journal_mode", "wal"),  # Use WAL-mode (you should always use this!).
 | |
|         ("foreign_keys", 1),
 | |
|     ),
 | |
| )
 | |
| 
 | |
| 
 | |
| class BaseModel(Model):
 | |
|     class Meta:
 | |
|         database = db
 |