Giter Site home page Giter Site logo

SQLAlchemy support? about eve HOT 45 CLOSED

pyeve avatar pyeve commented on July 4, 2024
SQLAlchemy support?

from eve.

Comments (45)

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

Hello!

I'd love to add PostgreSQL support but it's not something I would feel confident doing right now as I don't work with that DB (not in Python at least). PostgreSQL support would be a fantastic opportunity for other contributors to jump in! There's a DataLayer interface in place already, ready to be abused. If somebody wants to help well, let's get in touch!

from eve.

mario avatar mario commented on July 4, 2024

I assume we can use flask-SqlAlchemy to kill several flies with one kill?

from eve.

mario avatar mario commented on July 4, 2024

Do you frequent any irc channels, skype, gtalk or something? So we can talk what would be involved in this.

from eve.

inactivist avatar inactivist commented on July 4, 2024

I'm interested, if only to help test. Not sure what I can do on the dev side.

from eve.

mario avatar mario commented on July 4, 2024

Here's a bounty - anyone that implements this properly gets a small VM at 6sync for three months! And you get to contribute to open source!

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

I guess Flask-SqlAlchemy would work, although I'm not sure a full featured ORM is needed. Again, I'm out of my comfort zone here so I'm open to discussion, ideas and pull requests.

I've been amusing myself with the idea of an irc channel for Eve, but it seemed a bit overkill at this stage. Also, by keeping the discussion here we allow everybody interested to easily jump in with his/her opinions and ideas.

from eve.

mario avatar mario commented on July 4, 2024

I'm all for irc channel, let's go!

from eve.

LarryEitel avatar LarryEitel commented on July 4, 2024

I too am very interested in collaborating with anyone working with/on
Nicola's awesome API!!! :) Skype Group is excellent or perhaps Google
Hangout. IRC is great too especially if dev's are aware of it's existence.
Perhaps the Flask IRC channel is good place to hang.

On Tue, Feb 26, 2013 at 10:19 AM, Mario Đanić [email protected]:

I'm all for irc channel, let's go!


Reply to this email directly or view it on GitHubhttps://github.com/nicolaiarocci/eve/issues/17#issuecomment-14123448
.

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

@inactivist hey man I'm sure you can lend a hand in one way or another!

from eve.

mario avatar mario commented on July 4, 2024

IRC channel is now on freenode #evehq :)

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

the cat is out of the bag I guess

from eve.

inactivist avatar inactivist commented on July 4, 2024

Is it reasonable for SQL support to exclude dict and list (nested) schema data types?

from eve.

mario avatar mario commented on July 4, 2024

I think supporting whatever sqlalchemy supports is fine :)

On Friday, March 8, 2013, Michael Curry wrote:

Is it reasonable for SQL support to exclude dict and list schema data
types?


Reply to this email directly or view it on GitHubhttps://github.com/nicolaiarocci/eve/issues/17#issuecomment-14626354
.

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

@inactivist I guess we could get away with that, at least on initial release. Remember you can have your own custom data validator within the SQL subpackage (for reference, see the validator for the mongo subpackage).

from eve.

Tefnet avatar Tefnet commented on July 4, 2024

If someone would like to test/review - here is my initial implementation:
Tefnet@963769f

from eve.

kpanic avatar kpanic commented on July 4, 2024

@Tefnet If someone else will not pickup your branch, I would like to try it and add tests to it this weekend!

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

@Tefnet at quick glance it looks like a great start! I'll review it later, thank you!
@kpanic please join in!

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

A quick note (haven't looked at the code yet). It seems kind of awkward that one has to define the schema twice, one for SQLAlchemy and another in settings.py.

from eve.

mario avatar mario commented on July 4, 2024

I don't find that particularly strange due to the way Eve works - however, one could write a script to translate the SQLAlchemy models and spit out Cerberus validation rules for settings.py.

from eve.

Tefnet avatar Tefnet commented on July 4, 2024

I've made simple decorator for SQLAlchemy model Tefnet@bfb3798
but there are a couple of problems:

  1. Sometimes it is hard to map SQLAlchemy property to eve schema (for example composite column property)
  2. Right now I don't know how it could be registered in app. The problem is that I think I need app.driver to setup models, but I get it from app instance when config/schema is already parsed.

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

I wouldn't worry much about the double definition, not now at least. Agree with @mario however, a script would be a nice tool. @Tefnet I added some comments to your repo. Very encouraging, thank you!

from eve.

Tefnet avatar Tefnet commented on July 4, 2024

https://gist.github.com/Tefnet/5430309 simple demo with decorator for https://github.com/nicolaiarocci/eve/issues/45

from eve.

kpanic avatar kpanic commented on July 4, 2024

A WIP based on #45 related to SQLAlchemy tests:

branch: https://github.com/kpanic/eve/commits/sqlalchemy (might need a rebase from #45 )
settings: https://gist.github.com/kpanic/5431065

from eve.

mario avatar mario commented on July 4, 2024

Guys, let's push this properly - I have time this week, so let's meet up on IRC and at least finish something worthy of a release? :)

from eve.

mario avatar mario commented on July 4, 2024

Guys, you alive? :)

from eve.

nZac avatar nZac commented on July 4, 2024

Ping.

Has this gone anywhere? I would be interested in helping where I can. We might be able to use something like this at work so I could devote some time to getting SQLAlchemy up and running.

from eve.

mario avatar mario commented on July 4, 2024

Hi,

are you on irc @nZac? Let's talk!

Cheers.

from eve.

nZac avatar nZac commented on July 4, 2024

#python-eve right?

from eve.

mario avatar mario commented on July 4, 2024

Yup.

On Mon, Jul 15, 2013 at 5:17 PM, Nick Zaccardi [email protected]:

#python-eve right?


Reply to this email directly or view it on GitHubhttps://github.com/nicolaiarocci/eve/issues/17#issuecomment-20976637
.

from eve.

mario avatar mario commented on July 4, 2024

@nZac nZac around? :)

from eve.

alanhamlett avatar alanhamlett commented on July 4, 2024

This gist might help:
https://gist.github.com/alanhamlett/6604662
Model.to_dict turns a Model (and it's relationships) into a Python dict ready for serializing
Model.set_columns takes a dict and updates a Model (and it's relationships)

from eve.

reissmann avatar reissmann commented on July 4, 2024

What's the current status on this? Is only testing needed or is essential implementation work still missing?

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

there's a guy on the mailing list who's willing to work on the branch and is looking for help. Another guy jumped in (via email).

I'm still interested in merging as soon as it is mature enough so everybody is welcome to chime in (maybe by answering to that message on the ML in the first place).

from eve.

amleczko avatar amleczko commented on July 4, 2024

I have also started to work on my fork - https://github.com/RedTurtle/eve/tree/sqlalchemy based on @Tefnet branch.

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

@amleczko this is very interesting, consider getting in touch with the guys on the mailing list so maybe you can join efforts.

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

Hello everybody, I just merged a huge PR to the SQLAlchemy branch. It brings the functionality almost on par (with some tests and refactoring) with current Eve 0.4-dev so you may all want to work on it.

Author's comment on the PR (#311)

I moved forward the SQLAlchemy branch to support all the changes happened to Eve since last commit to the branch, or at least the ones affecting the find methods of the data layer. The current state of the SQLAlchemy support is a bit of a regression since I haven't updated the previous implementations of the find_one and insert methods in the data layer to comply with Eve 0.4. Mostly though I kicked off some tests for SQL DBs by porting them from the get method tests of Mongo. Hopefully this means we can make progress on the branch a little faster.

For reference:

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

All those interested, #321 (support for DELETE and lots of tests) was just merged to the SQLAlchemy branch.

Things are moving forward rather quickly now and I'd really appreciate if someone would code-review and/or contribute to the sql branch.

from eve.

amleczko avatar amleczko commented on July 4, 2024
  1. What is the best way/place to review the code?
  2. I have several questions regarding schema registration that are not code-review related but more general principles sqlalchemy branch is following; where should I ask/discuss them?

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

@amleczko I invited the main sql contributor to join the mailing list. Also, #326 has just been merged to the sql branch.

from eve.

dedalusj avatar dedalusj commented on July 4, 2024

I'm the contributor to the merges to the SQL branch of Eve. I just applied to join the mailing list so we should be able to discuss this there soon.

Meanwhile...in the past few weeks I focused on getting to near feature parity with eve 0.4-dev and more importantly in porting the relevant integration tests to SQL.

I'm sure there is plenty of room for improvement in my implementation, especially for supporting features that are particular to SQL like composite primary keys. Here is a list of things I have planned for the immediate future or where people could focus:

  • The most important thing at the moment would be to review the tests. They all pass but it would be nice to have someone go over them to make sure I haven't fooled myself here and there.
  • There is A LOT of repeated code between the tests for Mongo and the tests for SQL. It would be nice to make them DRY so that new tests can be added easily to both extensions.
  • General review of the extension code to see if anything can be simplified or improved. I moved pretty quickly in the past few weeks and I may have overlooked a better implementation.

from eve.

petrjasek avatar petrjasek commented on July 4, 2024

There is A LOT of repeated code between the tests for Mongo and the tests for SQL. It would be nice to make them DRY so that new tests can be added easily to both extensions.

👍 that would be also useful for elastic extension

from eve.

jofell avatar jofell commented on July 4, 2024

Hi. We are trying out the SQLAlchemy branch, and we're wondering if the filters feature are already integrated. If it is, we would like to know how they are invoked on the API (like how does the where query work?)

If in case it's not yet here, we would love to help out to contribute code, and also we would like to know if you guys have any preference as to how the where query should look like.

Cheers!

from eve.

dedalusj avatar dedalusj commented on July 4, 2024

Yes they are although only in the python form. I made no effort to support the Mongo query syntax.
This is an example request of a where filter in action:

http://127.0.0.1:5000/people/?where=firstname==George

where obviously firstname is a column of the people table/resource. Since I'm supporting the Python syntax any valid combination of conditionals and logical operators should work. Please let me know if you find any issues

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

Status update: Python 3.4 compatibility has just been added with PR #382. Cheers!

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 4, 2024

Also see PR #424 which I find very interesting.

from eve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.