SQLModel: The New ORM for FastAPI and Beyond - Talk Pythonto Me Ep.353

Поділитися
Вставка
  • Опубліковано 19 вер 2024

КОМЕНТАРІ • 61

  • @devguyahnaf
    @devguyahnaf 2 роки тому +17

    I really enjoyed watching this, I'm glad Ramirez is getting recognition for building such a nice framework

    • @mikeckennedy
      @mikeckennedy 2 роки тому +1

      I agree. People do love his work.

  • @harshithyadav1070
    @harshithyadav1070 2 роки тому +4

    The legendary framework builder Ramirez 😃😃😃😃

    • @talkpython
      @talkpython  2 роки тому

      Indeed, it was great to have him on the podcast.

  • @blackswan2020
    @blackswan2020 2 роки тому +1

    Michael's videos are so clear and helpful!! Seriously so underrated

  • @holax3132
    @holax3132 Рік тому

    I am very glad that I stumbled upon your video

  • @RaymondPeckIII
    @RaymondPeckIII 11 місяців тому

    Regarding deserializing nested JSON into your own set of nested classes, I'm using the dacite library and it's been working well. I've forked it (and may have time to contribute that back at some point) so that I can use different field names and paths within the JSON in the object graph than were present in the original JSON. This is really useful for providing a nice internal class hierarchy and object graph from a messy JSON format you get from a 3rd party.

  • @sqr_asd_qrsh
    @sqr_asd_qrsh Рік тому

    ITS WORKING! nice job dude

  • @hansdietrich1496
    @hansdietrich1496 Рік тому

    Thanks for the podcast, good interview!

  • @linghaoyi
    @linghaoyi Рік тому

    Thank you for your excellent talk show. Merry Christmas and Happy New Year!

  • @holax3132
    @holax3132 Рік тому

    Nice tutorial.... Very helpful

  • @gtalucifer6838
    @gtalucifer6838 Рік тому

    thank you straight to the point

  • @jamalhossain8954
    @jamalhossain8954 Рік тому

    Thank you for this! Super cool video! A+++

  • @StrategicCIS
    @StrategicCIS Рік тому

    Is there a tutorial showing the use of FastAPI and SQLModel with a remote DB? Everything is demonstrated local with SQLite.

  • @ZakKohler
    @ZakKohler 8 місяців тому

    When is Sebastian going to do this for Dataframes e.g. pandas?

  • @DreamsAPI
    @DreamsAPI 10 місяців тому

    So using sqlmodel we don't need sqlalchemy?

  • @mariusj8542
    @mariusj8542 2 роки тому

    Just ported a solution from Flask with Marshmallows to Fastapi with sqlalchamy and Pydantic, very nice love Orm models, but still could do something with the sql output. I still need to do some json/dict tricks but that is perhaps what he is working on.(sqlmodel), need to look into that.

    • @talkpython
      @talkpython  2 роки тому

      Perhaps. I'm not sure of Sebastian's plans. But with Pydantic you can do a lot to control the ingest/output for JSON with the .dict(). So it might make sense to dive into Pydantic looking for answers more than SQLModel directly.

  • @SanthoshAC-p3s
    @SanthoshAC-p3s 9 місяців тому

    I have a question regarding sqlmodel and pydantic. I created a class based on sqlmodel, and now I want to use that for data validation using pydantic @validator (decorotor) and perform an ORM operation. So how do I do it?

  • @repotranstech9614
    @repotranstech9614 Рік тому

    Since its a young framework can it be integrated with htmx out of the box.

  • @iminheaven3505
    @iminheaven3505 11 місяців тому

    supports Async?

  • @عبدالرحمنعليابراهيمخميس

    Thanks so much

  • @laqi1787
    @laqi1787 2 роки тому

    FastAPI is nice , I quite like it

  • @tarikurrahaman2720
    @tarikurrahaman2720 2 роки тому +3

    how to override the table name?

    • @mikeckennedy
      @mikeckennedy 2 роки тому +1

      I haven't tried with SQLModel, but in SQLAlchemy you can put `__tablename__ = "the table name"` in the class by the fields and it changes the name. Does it work here?

    • @nitinbhatt6534
      @nitinbhatt6534 2 роки тому +2

      @@mikeckennedy I have come across this scenario before, and yes __tablename__ will work on this scenario

    • @talkpython
      @talkpython  2 роки тому

      Cool, thanks for letting everyone know.

  • @khushaltrivedi9829
    @khushaltrivedi9829 2 роки тому

    When migration documents will get updated?

  • @vme50eatkfc
    @vme50eatkfc 2 роки тому

    When would the API references be added to FastAPI, it's such a must-have thing...

    • @talkpython
      @talkpython  2 роки тому

      Hi. Are you referring to some docs showing how to use SQLModel & FastAPI together?

    • @djlinux64
      @djlinux64 2 роки тому

      Its in the sqlmodel docs

  • @jay_ramesh
    @jay_ramesh Рік тому

    thank you bro thank you

  • @apartiwari9361
    @apartiwari9361 2 роки тому +1

    how does this compares to or differenciate from piccolo ORM, new to both and trying to learn the best one

    • @talkpython
      @talkpython  2 роки тому

      We did interview them awhile ago here: talkpython.fm/328
      In terms of differences, there are both a sync which is great. Piccolo has a better query syntax but this has pedantic integration which is nice and very useful in FastAPI.

    • @apartiwari9361
      @apartiwari9361 2 роки тому

      @@talkpython I see, Thanks :)

  • @Mathias-cq3zo
    @Mathias-cq3zo 2 роки тому +1

    Wonder if we ever will have a Frontend Framework by Python, I mean sth as popular as React or Vue.

    • @talkpython
      @talkpython  2 роки тому +2

      Hey. Interesting ideas. What Microsoft is doing with blazer and web assembly should be immediately copied in python. ;) for note, we do have projects like Anvil and Idom.

    • @qang_qang
      @qang_qang Рік тому

      ua-cam.com/video/kxsLRRY2xZA/v-deo.html

  • @fullstackspiderman
    @fullstackspiderman 2 роки тому

    May I know what is the alternate of django's get_or_create in SQLModel in FastAPI? to handle error "unique violation" that occurs when we write in many-to-many with extra fields in a link table..

    • @talkpython
      @talkpython  2 роки тому +2

      Not 100% sure, but I'd focus on how to do this in SQLAlchemy as that's the underlying system. The unit of work/session should make it atomic and transcational. So just catch a sqlalchemy.exc.IntegrityError exception, that'd be the signal.

    • @fullstackspiderman
      @fullstackspiderman 2 роки тому

      @@talkpython Thank you Michael. In my case, I had to catch PendingRollbackError, IntegrityError.

  • @mahitgaming1774
    @mahitgaming1774 Рік тому

    all is good

  • @royzac7829
    @royzac7829 2 роки тому

    How are views created?

  • @mixdevdev3955
    @mixdevdev3955 2 роки тому

    hello so how to use mysql with fastapi without ORM?

    • @talkpython
      @talkpython  2 роки тому

      It's the same as any other mysql code from Python. For example: www.mysqltutorial.org/python-mysql/

  • @hugoramex3421
    @hugoramex3421 2 роки тому

    i really hope it was based on ponyORM ( the fastest ORM for me ) instead of SQLAlchemy

    • @talkpython
      @talkpython  2 роки тому

      The newer ORMs are nice aren't they? Beanie is my fav and powers talkpython.fm. ;)

  • @astroboy512
    @astroboy512 2 роки тому +1

    About this: ua-cam.com/video/BTCtKWpNoRI/v-deo.htmlm40s
    I think that it should happen the other way around: python guys, ruby guys, etc., should go to all browser makers. And they should show off a *really* cool solution because I don't see why the browser makers would have the motivation to go to somebody.
    This is a little similar to Kotlin and Google story. Where guys from the Kotlin team went to Google, showed how cool the language is, how well it integrates with Java, etc., so Google decided to make Kotlin the #1 recommended programming language for android.
    If somebody from the python community could develop a really great solution, then the addition of python runtime to browsers could happen.

    • @talkpython
      @talkpython  2 роки тому

      I think there is some middle ground: the frameworks/language folks should be responsible for getting their runtimes built and shipped in web assembly in the Dane cadence as their main runtimes.
      But the browser makers should pick them up and run with it. We get nearly weekly updates for browsers as is and with everything auto update, it would be easy for these to just appear. Last thing needed is a common way to access the languages out of script. :)

  • @drygordspellweaver8761
    @drygordspellweaver8761 2 роки тому

    Do you think FastAPI is the future?

    • @talkpython
      @talkpython  2 роки тому +1

      It certainly has the very highest growth rate, and makes up about 15% of the web market (whereas another 80% is evenly split between Flask and Django). It is very likely to be the future for APIs for a some time. It can be for web apps, but that is an open question I think. Flask + Django are still good choices too.

  • @iamworstgamer
    @iamworstgamer 10 місяців тому

    but it still does not support sqlalchemy 2.0

  • @hamzaqurayshi5133
    @hamzaqurayshi5133 Рік тому

    my mom told me the computer is the devil
    😃

  • @Amapramaadhy
    @Amapramaadhy 2 роки тому

    Dude should let his guest speak! sheesh

    • @talkpython
      @talkpython  2 роки тому +5

      Our transcript software breaks down the time by each speaker:
      Sebastian [guest] (59%)
      Michael ['dude'] (41%)
      Having the guest speak 60% of the time seems like a good amount. Would you prefer a monolog?

  • @v4ldevrr4m47
    @v4ldevrr4m47 2 роки тому

    @sebastian gif us this talk in spanish please #latincomunnity