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

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 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.

  • @blackswan2020
    @blackswan2020 2 ปีที่แล้ว +1

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

  • @harshithyadav1070
    @harshithyadav1070 2 ปีที่แล้ว +4

    The legendary framework builder Ramirez 😃😃😃😃

    • @talkpython
      @talkpython  2 ปีที่แล้ว

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

  • @holax3132
    @holax3132 2 ปีที่แล้ว

    I am very glad that I stumbled upon your video

  • @RaymondPeckIII
    @RaymondPeckIII ปีที่แล้ว

    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.

  • @hansdietrich1496
    @hansdietrich1496 ปีที่แล้ว

    Thanks for the podcast, good interview!

  • @linghaoyi
    @linghaoyi ปีที่แล้ว

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

  • @sqr_asd_qrsh
    @sqr_asd_qrsh 2 ปีที่แล้ว

    ITS WORKING! nice job dude

  • @holax3132
    @holax3132 2 ปีที่แล้ว

    Nice tutorial.... Very helpful

  • @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.

  • @StrategicCIS
    @StrategicCIS ปีที่แล้ว

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

  • @gtalucifer6838
    @gtalucifer6838 2 ปีที่แล้ว

    thank you straight to the point

  • @jamalhossain8954
    @jamalhossain8954 2 ปีที่แล้ว

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

  • @عبدالرحمنعليابراهيمخميس
    @عبدالرحمنعليابراهيمخميس 2 ปีที่แล้ว

    Thanks so much

  • @repotranstech
    @repotranstech ปีที่แล้ว

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

  • @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 :)

  • @SanthoshAC-p3s
    @SanthoshAC-p3s 11 หลายเดือนก่อน

    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?

  • @ZakKohler
    @ZakKohler 10 หลายเดือนก่อน

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

  • @khushaltrivedi9829
    @khushaltrivedi9829 2 ปีที่แล้ว

    When migration documents will get updated?

  • @DreamsAPI
    @DreamsAPI ปีที่แล้ว

    So using sqlmodel we don't need sqlalchemy?

  • @laqi1787
    @laqi1787 2 ปีที่แล้ว

    FastAPI is nice , I quite like it

  • @iminheaven3505
    @iminheaven3505 ปีที่แล้ว

    supports Async?

  • @jay_ramesh
    @jay_ramesh 2 ปีที่แล้ว

    thank you bro thank you

  • @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.

  • @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 2 ปีที่แล้ว

      th-cam.com/video/kxsLRRY2xZA/w-d-xo.html

  • @mahitgaming1774
    @mahitgaming1774 2 ปีที่แล้ว

    all is good

  • @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

  • @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.

  • @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/

  • @astroboy512
    @astroboy512 2 ปีที่แล้ว +1

    About this: th-cam.com/video/BTCtKWpNoRI/w-d-xo.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. :)

  • @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. ;)

  • @royzac7829
    @royzac7829 2 ปีที่แล้ว

    How are views created?

  • @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 ปีที่แล้ว

    but it still does not support sqlalchemy 2.0

  • @hamzaqurayshi5133
    @hamzaqurayshi5133 2 ปีที่แล้ว

    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