mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
14 lines
328 B
Python
14 lines
328 B
Python
import sqlite3
|
|
from sqlite3 import Connection
|
|
from typing import Iterable
|
|
|
|
from dishka import Provider, Scope, provide
|
|
|
|
|
|
class ConnectionProvider(Provider):
|
|
@provide(scope=Scope.REQUEST)
|
|
def new_connection(self) -> Iterable[Connection]:
|
|
conn = sqlite3.connect(":memory:")
|
|
yield conn
|
|
conn.close()
|