Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Postgres.py under the hood #41

Closed
chadwhitacre opened this issue Feb 13, 2016 · 17 comments
Closed

use Postgres.py under the hood #41

chadwhitacre opened this issue Feb 13, 2016 · 17 comments

Comments

@chadwhitacre
Copy link
Contributor

Over in Gratipay-land we've got a library called Postgres.py that has a very similar scope to Records-the-library (it has no CLI). It's been in production for three or four years, and as you say, it's "much more robust" than Records from an API point of view. I know you're opinionated about API design. I believe Postgres.py's API is worthy (or nearly so) of the "for Humans" appellation (and I'm not sure I didn't actually run that by you at some point in the past ;-).

I like the Tablib integration and CLI that I see here on Records, and our APIs are pretty close.

@kennethreitz Would you be open to a PR that switches Records to use Postgres.py under the hood? I'd envision keeping the CLI exactly the same. I think we'd need to talk through API—what gets wrapped, what gets exposed, what might be upstreamed.

Waddya say? Up for collaborating? :-)

@chadwhitacre
Copy link
Contributor Author

(Twitter context)

@kennethreitz
Copy link
Owner

Honestly, my immediate reaction is "I'm not sure", leaning towards "no".

1. Little/No Benefit: Records, as it stands, is a very thin layer on top of psycopg2, which, for the feature set that Records currently provides, is a perfect fit. In other words, I don't think moving to something else would provide any benefit at this time.

2. Other Databases: Also, there has been some consideration for adding support for other database backends. If we were to do this, it would likely be in the form of using SQLAlchemy as a database driver. So, relying on another Postgres library would take a step away towards that (currently non–) goal.

3. Too Early: That being said, at the moment, I'm deciding to stick with Postgres-only support (mostly because of very subtle differences in the way querys can be expressed in SQLAlchemy). I'm reconsidering it constantly, though, so this is further reason to not make any big dependency commitments at this time.

@kennethreitz
Copy link
Owner

Just pushed the release built on top of SQLAlchemy :D

@chadwhitacre
Copy link
Contributor Author

Alright. Good luck! :-)

@kennethreitz
Copy link
Owner

@whit537 😭

@chadwhitacre
Copy link
Contributor Author

No worries. I think you just made DB-API 3.0, and I like it. :-)

@chadwhitacre
Copy link
Contributor Author

P.S. I would be remiss not to note that @3kwa ported the basic API from Postgres.py for other databases in https://github.com/3kwa/sql.

@3kwa
Copy link

3kwa commented Feb 13, 2016

@kennethreitz must be a better brand in the Python sphere. Thought of you @whit537 when I saw records pop all over the place.

@chadwhitacre
Copy link
Contributor Author

:-)

@kennethreitz
Copy link
Owner

I'm the Kanye West of Python.

(That's my Kanye impersonation)

@kennethreitz
Copy link
Owner

Well, we're much less in competition now that Records is powered by SQLAlchemy. So, the sky's the limit!

@chadwhitacre
Copy link
Contributor Author

Well, we're much less in competition now that Records is powered by SQLAlchemy.

Mmmm ... over here it feels like we're much less in competition because Records has already nuked Postgres.py and sql out of the water in terms of open-source mindshare.

screen shot 2016-02-13 at 11 42 46 am
screen shot 2016-02-13 at 11 42 58 am
screen shot 2016-02-13 at 11 43 14 am

I'm not gonna say that doesn't burn a little bit, but branding and community matter at least as much as code, and you're purty good at all three. 😸 At the end of the day what really matters is that the Python community is finally getting a sane SQL API. 🍻

@kennethreitz
Copy link
Owner

^L

@3kwa
Copy link

3kwa commented Feb 13, 2016

Wow does that mean sql is 1st in watch, star and fork 💃

@chadwhitacre
Copy link
Contributor Author

Wow does that mean sql is 1st in watch, star and fork 💃

Hah! You're the best around! 💃

^L

Yeah, I finally ate crow on Aspen recently as well. Over there I never got the code to the level of polish I wanted, but I was actually really proud of Postgres.py. It was well-designed, well-documented, well-tested, ported to Python 3 ... tight!

@chadwhitacre
Copy link
Contributor Author

Hey! Here's another one called Queries from @gmr. I found it on http://awesome-python.com/ after googling for "postgres python for humans."

Queries is inspired by Kenneth Reitz's awesome work on requests.

Looks like it's older than Postgres.py (initial commit on Queries is August 24, 2012, based on prior work; initial commit on Postgres.py is from Aug 7, 2013, based on internal Gittipay code going back to at least June 1, 2012).

@gmr Looks like you came in second! Or third, depending on how we're counting it. ;-)

screen shot 2016-02-13 at 5 31 51 pm

@chadwhitacre
Copy link
Contributor Author

vinta/awesome-python#567 ← Postgres.py
vinta/awesome-python#568 ← sql
vinta/awesome-python#569 ← Records

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants