Skip to content

Implement gel.Record type#560

Merged
1st1 merged 4 commits intomasterfrom
record2
Dec 12, 2024
Merged

Implement gel.Record type#560
1st1 merged 4 commits intomasterfrom
record2

Conversation

@1st1
Copy link
Member

@1st1 1st1 commented Dec 12, 2024

It's returned from client.query_sql() and represents SQL rows.

Currently it supports:

  • integer indexing - fetch columns by position
  • string indexing - fetch columns by name
  • as_dict() method - render record as a dict

ToDo:

  • add iter

It's returned from `client.query_sql()` and represents
SQL rows.

Currently it supports:

* integer indexing - fetch columns by position
* string indexing - fetch columns by name
* as_dict() method - render record as a dict

ToDo:

* add __iter__
@1st1 1st1 requested review from elprans, fantix and msullivan December 12, 2024 22:15
if (_EdgeGeneric_RenderItems(&writer,
(PyObject *)o, o->desc,
o->ob_item, Py_SIZE(o), 1, 0) < 0)
o->ob_item, Py_SIZE(o), 1, 1, 0) < 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really need to fix this now, but this sort of list of boolean arguments ought to either have comments saying what each of the argument names are or should use #defines/enums or flag bits or something. 1, 1, 0 is inscrutable.

This is an existing problem, though, so it's fine to skip fixing it now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer

Copy link
Member

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. Kind of a lot of duplication, but you said that merging it would be worse?

@1st1
Copy link
Member Author

1st1 commented Dec 12, 2024

@msullivan

Kind of a lot of duplication

What's duplicated? Besides the Record codec looking like a stripped down Object codec?

Edit: here's the previous attempt 00650b0

@1st1 1st1 merged commit ff3aad2 into master Dec 12, 2024
@1st1 1st1 deleted the record2 branch December 12, 2024 22:56
msullivan added a commit that referenced this pull request Feb 23, 2025
EdgeDB has been renamed to Gel, and so has this python package.

Changes
=======

* Rename the package to gel! The package still provides an ``edgedb``
  module in addition to ``gel``, but ``gel`` is now preferred.
  (by @msullivan in 83349d4 for #566)

* Allow cloud instance names to contain '-' and '_' in the org part to support vercel instances
  (by @msullivan in 5b5be68 for #1084)

* Support specifying SNI tls_server_name
  (by @msullivan in 6b28b98 for #1088)

* Support GEL_ env vars and gel.toml
  (by @msullivan in d0b3961 for #532)

* Add support for protocol 3.0
  (by @elprans in 2e6a877 for #534)

* Add support for newly exposed Postgres types
  (by @elprans in 48a67c1)

* Kill pre-1.0 forever deprecated API / dead code.
  (by @1st1 in 8669e78)

* Rename main module from edgedb to gel
  (by @msullivan in 10d61a1 for #544)

* Support the gel:// dsn protocol
  (by @msullivan in 84c533c for #546)

* Add a way to export SQLAlchemy models from Gel (EdgeDB).
  (by @vpetrovykh in 645fce0 for #536)

* Implement gel.Record type
  (by @1st1 in ff3aad2 for #560)

* Add ORM model generators for Django, SQLAlchemy, sqlmodel.
  (by @vpetrovykh in ad37a6b)

* Add support for REPEATABLE READ isolation (requires server support)
  (by @elprans in 8f40d0e for #565)

* Retry calls to `execute` as well as to `query`
  (by @msullivan in e263f2b for #577)

* Add support for running (and installing) the main CLI
  (by @elprans in 023697a for #572)

* Rename AI to RAGClient and add compat names
  (by @fantix in e5aae27 for #578)
@msullivan msullivan mentioned this pull request Feb 23, 2025
msullivan added a commit that referenced this pull request Feb 23, 2025
EdgeDB has been renamed to Gel, and so has this python package.

Changes
=======

* Rename the package to gel! The package still provides an ``edgedb``
  module in addition to ``gel``, but ``gel`` is now preferred.
  (by @msullivan in 83349d4 for #566)

* Allow cloud instance names to contain '-' and '_' in the org part to support vercel instances
  (by @msullivan in 5b5be68 for #1084)

* Support specifying SNI tls_server_name
  (by @msullivan in 6b28b98 for #1088)

* Support GEL_ env vars and gel.toml
  (by @msullivan in d0b3961 for #532)

* Add support for protocol 3.0
  (by @elprans in 2e6a877 for #534)

* Add support for newly exposed Postgres types
  (by @elprans in 48a67c1)

* Kill pre-1.0 forever deprecated API / dead code.
  (by @1st1 in 8669e78)

* Rename main module from edgedb to gel
  (by @msullivan in 10d61a1 for #544)

* Support the gel:// dsn protocol
  (by @msullivan in 84c533c for #546)

* Add a way to export SQLAlchemy models from Gel (EdgeDB).
  (by @vpetrovykh in 645fce0 for #536)

* Implement gel.Record type
  (by @1st1 in ff3aad2 for #560)

* Add ORM model generators for Django, SQLAlchemy, sqlmodel.
  (by @vpetrovykh in ad37a6b)

* Add support for REPEATABLE READ isolation (requires server support)
  (by @elprans in 8f40d0e for #565)

* Retry calls to `execute` as well as to `query`
  (by @msullivan in e263f2b for #577)

* Add support for running (and installing) the main CLI
  (by @elprans in 023697a for #572)

* Rename AI to RAGClient and add compat names
  (by @fantix in e5aae27 for #578)
msullivan added a commit that referenced this pull request Feb 23, 2025
EdgeDB has been renamed to Gel, and so has this python package.

Changes
=======

* Rename the package to gel! The package still provides an ``edgedb``
  module in addition to ``gel``, but ``gel`` is now preferred.
  (by @msullivan in 83349d4 for #566)

* Allow cloud instance names to contain '-' and '_' in the org part to support vercel instances
  (by @msullivan in 5b5be68 for #1084)

* Support specifying SNI tls_server_name
  (by @msullivan in 6b28b98 for #1088)

* Support GEL_ env vars and gel.toml
  (by @msullivan in d0b3961 for #532)

* Add support for protocol 3.0
  (by @elprans in 2e6a877 for #534)

* Add support for newly exposed Postgres types
  (by @elprans in 48a67c1)

* Kill pre-1.0 forever deprecated API / dead code.
  (by @1st1 in 8669e78)

* Rename main module from edgedb to gel
  (by @msullivan in 10d61a1 for #544)

* Support the gel:// dsn protocol
  (by @msullivan in 84c533c for #546)

* Add a way to export SQLAlchemy models from Gel (EdgeDB).
  (by @vpetrovykh in 645fce0 for #536)

* Implement gel.Record type
  (by @1st1 in ff3aad2 for #560)

* Add ORM model generators for Django, SQLAlchemy, sqlmodel.
  (by @vpetrovykh in ad37a6b)

* Add support for REPEATABLE READ isolation (requires server support)
  (by @elprans in 8f40d0e for #565)

* Retry calls to `execute` as well as to `query`
  (by @msullivan in e263f2b for #577)

* Add support for running (and installing) the main CLI
  (by @elprans in 023697a for #572)

* Rename AI to RAGClient and add compat names
  (by @fantix in e5aae27 for #578)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants