]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add Identity() for remaining examples
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Jan 2024 14:29:28 +0000 (09:29 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Jan 2024 14:30:09 +0000 (09:30 -0500)
Fixed the performance example scripts in examples/performance to mostly
work with the Oracle database, by adding the :class:`.Identity` construct
to all the tables and allowing primary generation to occur on this backend.
A few of the "raw DBAPI" cases still are not compatible with Oracle.

Change-Id: I7ce19645ea78736dddfda6f33b9356ad75dee68f

doc/build/changelog/unreleased_20/examples.rst [new file with mode: 0644]
examples/performance/bulk_updates.py
examples/performance/large_resultsets.py
examples/performance/short_selects.py
examples/performance/single_inserts.py

diff --git a/doc/build/changelog/unreleased_20/examples.rst b/doc/build/changelog/unreleased_20/examples.rst
new file mode 100644 (file)
index 0000000..8ac2c56
--- /dev/null
@@ -0,0 +1,8 @@
+.. change::
+    :tags: bug, examples
+
+    Fixed the performance example scripts in examples/performance to mostly
+    work with the Oracle database, by adding the :class:`.Identity` construct
+    to all the tables and allowing primary generation to occur on this backend.
+    A few of the "raw DBAPI" cases still are not compatible with Oracle.
+
index c15d0f167269027fd1d056afa8e80457bf2b90c3..8b782353df0cf1d8354d3e3ad4dc678562110406 100644 (file)
@@ -5,6 +5,7 @@ of rows in bulk (under construction! there's just one test at the moment)
 """
 from sqlalchemy import Column
 from sqlalchemy import create_engine
+from sqlalchemy import Identity
 from sqlalchemy import Integer
 from sqlalchemy import String
 from sqlalchemy.ext.declarative import declarative_base
@@ -18,7 +19,7 @@ engine = None
 
 class Customer(Base):
     __tablename__ = "customer"
-    id = Column(Integer, primary_key=True)
+    id = Column(Integer, Identity(), primary_key=True)
     name = Column(String(255))
     description = Column(String(255))
 
index 9c0d9fc4e2155cc976a55c50d6bb5671e6c0985d..b93459150e5719f0f353d48286e33d0ac7b75795 100644 (file)
@@ -15,6 +15,7 @@ provide a huge amount of functionality.
 """
 from sqlalchemy import Column
 from sqlalchemy import create_engine
+from sqlalchemy import Identity
 from sqlalchemy import Integer
 from sqlalchemy import String
 from sqlalchemy.ext.declarative import declarative_base
@@ -29,7 +30,7 @@ engine = None
 
 class Customer(Base):
     __tablename__ = "customer"
-    id = Column(Integer, primary_key=True)
+    id = Column(Integer, Identity(), primary_key=True)
     name = Column(String(255))
     description = Column(String(255))
 
index d0e5f6e9d22c2ba41214bcb392ffc00ad3e39599..553c2fed5f09890667ccfee76f60a52124240f80 100644 (file)
@@ -8,6 +8,7 @@ import random
 from sqlalchemy import bindparam
 from sqlalchemy import Column
 from sqlalchemy import create_engine
+from sqlalchemy import Identity
 from sqlalchemy import Integer
 from sqlalchemy import select
 from sqlalchemy import String
@@ -28,7 +29,7 @@ ids = range(1, 11000)
 
 class Customer(Base):
     __tablename__ = "customer"
-    id = Column(Integer, primary_key=True)
+    id = Column(Integer, Identity(), primary_key=True)
     name = Column(String(255))
     description = Column(String(255))
     q = Column(Integer)
index 991d213a07b86b2accfb3508c6eda2edfbec4f21..904fda2d03938ec52d92bc03a8ecb2a3dede476b 100644 (file)
@@ -7,6 +7,7 @@ a database connection, inserts the row, commits and closes.
 from sqlalchemy import bindparam
 from sqlalchemy import Column
 from sqlalchemy import create_engine
+from sqlalchemy import Identity
 from sqlalchemy import Integer
 from sqlalchemy import pool
 from sqlalchemy import String
@@ -21,7 +22,7 @@ engine = None
 
 class Customer(Base):
     __tablename__ = "customer"
-    id = Column(Integer, primary_key=True)
+    id = Column(Integer, Identity(), primary_key=True)
     name = Column(String(255))
     description = Column(String(255))