ace.database.connection

class ace.database.connection.ConnectionManager[source]

Bases: object

__init__()[source]
make_connection() pyodbc.Connection | None[source]
fetchone()[source]
fetchall()[source]
execute(sql_query, *params)[source]
close()[source]

Close the cursor and connection.

Idempotent and tolerant of partially-closed state:
  • Calling close() more than once is safe.

  • If the cursor was already closed elsewhere (e.g. a centralize helper or a with conn.cursor() as cur: block in a script), we still close the underlying connection so the SQL Server handle is released.

set_context()[source]
class ace.database.connection.SqlServerConnection[source]

Bases: ConnectionManager

make_connection()[source]
__init__()
close()

Close the cursor and connection.

Idempotent and tolerant of partially-closed state:
  • Calling close() more than once is safe.

  • If the cursor was already closed elsewhere (e.g. a centralize helper or a with conn.cursor() as cur: block in a script), we still close the underlying connection so the SQL Server handle is released.

execute(sql_query, *params)
fetchall()
fetchone()
set_context()
class ace.database.connection.SqlServerConnectionADIntegrated[source]

Bases: ConnectionManager

make_connection()[source]

Creates a SQL Server connection using Active Directory Integrated authentication. This method uses Windows/Azure AD authentication instead of SQL Server authentication. Use tcp: prefix to force TCP/IP protocol (not Named Pipes)

__init__()
close()

Close the cursor and connection.

Idempotent and tolerant of partially-closed state:
  • Calling close() more than once is safe.

  • If the cursor was already closed elsewhere (e.g. a centralize helper or a with conn.cursor() as cur: block in a script), we still close the underlying connection so the SQL Server handle is released.

execute(sql_query, *params)
fetchall()
fetchone()
set_context()
ace.database.connection.get_connection_class()[source]

Factory function to get the appropriate connection class based on DBMS_TYPE and DATABASE_AUTH_METHOD.

ace.database.connection.ace_connection

alias of SqlServerConnection