FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlmodel/sqlmodel/sql/sqltypes.py at main · zadevhub/sqlmodel · GitHub
zadevhub
sqlmodel
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlmodel
/
sqlmodel
/
sql
/
sqltypes.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (12 loc) · 542 Bytes
Breadcrumbs
sqlmodel
/
sqlmodel
/
sql
/
sqltypes.py
Copy path
File metadata and controls
16 lines (12 loc) · 542 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from
typing
import
Any
,
cast
from
sqlalchemy
import
types
from
sqlalchemy
.
engine
.
interfaces
import
Dialect
class
AutoString
(
types
.
TypeDecorator
):
impl
=
types
.
String
cache_ok
=
True
mysql_default_length
=
255
def
load_dialect_impl
(
self
,
dialect
:
Dialect
)
->
"types.TypeEngine[Any]"
:
impl
=
cast
(
types
.
String
,
self
.
impl
)
if
impl
.
length
is
None
and
dialect
.
name
==
"mysql"
:
return
dialect
.
type_descriptor
(
types
.
String
(
self
.
mysql_default_length
))
return
super
().
load_dialect_impl
(
dialect
)
Back
|
FazBrowse Home
|
New Git URL