Upgrade SQLAlchemy to 2.0, including initial work by farahats9 (#700)

Co-authored-by: Mohamed Farahat <farahats9@yahoo.com>
Co-authored-by: Stefan Borer <stefan.borer@gmail.com>
Co-authored-by: Peter Landry <peter.landry@gmail.com>
This commit is contained in:
Sebastián Ramírez
2023-11-18 12:30:37 +01:00
committed by GitHub
parent 77c6fed305
commit 8ed856d322
24 changed files with 808 additions and 510 deletions

View File

@@ -59,7 +59,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -315,7 +315,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -64,7 +64,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -239,7 +239,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -5,7 +5,7 @@ from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
openapi_schema = {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -103,7 +103,7 @@ openapi_schema = {
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -5,7 +5,7 @@ from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
openapi_schema = {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -103,7 +103,7 @@ openapi_schema = {
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -3,7 +3,7 @@ from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
openapi_schema = {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -135,7 +135,7 @@ openapi_schema = {
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -107,7 +107,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -622,7 +622,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -3,7 +3,7 @@ from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
openapi_schema = {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -91,7 +91,7 @@ openapi_schema = {
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -59,7 +59,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -315,7 +315,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -3,7 +3,7 @@ from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
openapi_schema = {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -79,7 +79,7 @@ openapi_schema = {
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -94,7 +94,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -579,7 +579,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},

View File

@@ -66,7 +66,7 @@ def test_tutorial(clear_sqlmodel):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.0.2",
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/heroes/": {
@@ -294,7 +294,9 @@ def test_tutorial(clear_sqlmodel):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},