File: misc_ext.py

package info (click to toggle)
sqlalchemy 2.0.45%2Bds1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 26,868 kB
  • sloc: python: 416,938; makefile: 231; sh: 7
file content (17 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import Any

from sqlalchemy import JSON
from sqlalchemy import Select
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.ext.mutable import MutableDict
from sqlalchemy.ext.mutable import MutableList
from sqlalchemy.sql.compiler import SQLCompiler


@compiles(Select[Any], "my_cool_driver")
def go(sel: Select[Any], compiler: SQLCompiler, **kw: Any) -> str:
    return "select 42"


MutableList.as_mutable(JSON)
MutableDict.as_mutable(JSON())