File tree 3 files changed +8
-0
lines changed
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Changelog
4
4
=========
5
+ Unreleased
6
+ ------
7
+ - Check whether charset name is available
8
+
5
9
0.15.4
6
10
------
7
11
- Don't generate a schema if there is no models (#254)
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Contributors
22
22
* Zoltán Szeredi ``@zoliszeredi ``
23
23
* Rebecca Klauser ``@svms1 ``
24
24
* Sina Sohangir ``@sinaso ``
25
+ * Weiming Dong ``@dongweiming ``
25
26
26
27
Special Thanks
27
28
==============
Original file line number Diff line number Diff line change 4
4
5
5
import aiomysql
6
6
import pymysql
7
+ from pymysql .charset import charset_by_name
7
8
from pypika import MySQLQuery
8
9
9
10
from tortoise .backends .base .client import (
@@ -76,6 +77,8 @@ def __init__(
76
77
self ._connection = None
77
78
78
79
async def create_connection (self , with_db : bool ) -> None :
80
+ if charset_by_name (self .charset ) is None : # type: ignore
81
+ raise DBConnectionError (f"Unknown charset { self .charset } " )
79
82
self ._template = {
80
83
"host" : self .host ,
81
84
"port" : self .port ,
You can’t perform that action at this time.
0 commit comments