Skip to content

Commit

Permalink
Start splitting pgcon
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Feb 26, 2025
1 parent 2fec20f commit 22d418b
Show file tree
Hide file tree
Showing 4 changed files with 904 additions and 850 deletions.
39 changes: 3 additions & 36 deletions edb/server/pgcon/pgcon.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# limitations under the License.
#

include "./pgcon_sql.pxd"

cimport cython
cimport cpython
Expand Down Expand Up @@ -57,40 +58,6 @@ cdef enum PGAuthenticationState:
PGAUTH_SASL_FINAL = 12


cdef enum PGAction:
START_IMPLICIT_TX = 0
PARSE = 1
BIND = 2
DESCRIBE_STMT = 3
DESCRIBE_STMT_ROWS = 4
DESCRIBE_PORTAL = 5
EXECUTE = 6
CLOSE_STMT = 7
CLOSE_PORTAL = 8
FLUSH = 9
SYNC = 10


cdef class PGMessage:
cdef:
PGAction action
bytes stmt_name
bytes portal_name
str orig_portal_name
object args
object query_unit
bint frontend_only
bint valid
bint injected

object orig_query
object fe_settings

cdef inline bint is_frontend_only(self)
cdef inline bint is_valid(self)
cdef inline bint is_injected(self)


@cython.final
cdef class PGConnection:

Expand Down Expand Up @@ -143,6 +110,8 @@ cdef class PGConnection:

str last_indirect_return

PGSQLConnection _sql

cdef before_command(self)

cdef write(self, buf)
Expand Down Expand Up @@ -188,8 +157,6 @@ cdef class PGConnection:
dict type_id_map,
)

cdef _rewrite_sql_error_response(self, PGMessage action, WriteBuffer buf)

cdef inline str get_tenant_label(self)
cpdef set_stmt_cache_size(self, int maxsize)

Expand Down
Loading

0 comments on commit 22d418b

Please sign in to comment.