Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. I haven't had to write a Python app that uses a database in a very long time.

I haven't had to write a Python app that uses a database in a very long time.

Scheduled Pinned Locked Moved Uncategorized
pythonsqlite
12 Posts 7 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

    I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

    PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

    #Python #SQLite

    glyph@mastodon.socialG This user is from outside of this forum
    glyph@mastodon.socialG This user is from outside of this forum
    glyph@mastodon.social
    wrote last edited by
    #2

    @badnetmask You can if you want to, but you could also use SQLAlchemy if you don't. What is your objection to writing SQL statements?

    badnetmask@hachyderm.ioB 1 Reply Last reply
    0
    • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

      I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

      PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

      #Python #SQLite

      cazabon@mindly.socialC This user is from outside of this forum
      cazabon@mindly.socialC This user is from outside of this forum
      cazabon@mindly.social
      wrote last edited by
      #3

      @badnetmask

      SQLAlchemy can do exactly what you describe; use it at the ORM level, and you need never write any SQL at all.

      It also makes your code (more) portable to other RDBMSes.

      1 Reply Last reply
      0
      • glyph@mastodon.socialG glyph@mastodon.social

        @badnetmask You can if you want to, but you could also use SQLAlchemy if you don't. What is your objection to writing SQL statements?

        badnetmask@hachyderm.ioB This user is from outside of this forum
        badnetmask@hachyderm.ioB This user is from outside of this forum
        badnetmask@hachyderm.io
        wrote last edited by
        #4

        @glyph @cazabon
        I'll take a look at SQLAlchemy, thanks.

        In essence I have nothing against SQL. I will write if I have to. I just thought after so many years we would be able to abstract that with plain Python statements.

        glyph@mastodon.socialG 1 Reply Last reply
        0
        • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

          I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

          PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

          #Python #SQLite

          shawnhooper@fosstodon.orgS This user is from outside of this forum
          shawnhooper@fosstodon.orgS This user is from outside of this forum
          shawnhooper@fosstodon.org
          wrote last edited by
          #5

          @badnetmask Another recommendation for SQLAlchemy.

          1 Reply Last reply
          0
          • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

            I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

            PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

            #Python #SQLite

            octarine_wiggle@mastodon.auO This user is from outside of this forum
            octarine_wiggle@mastodon.auO This user is from outside of this forum
            octarine_wiggle@mastodon.au
            wrote last edited by
            #6

            @badnetmask is this the thing you feel should exist in current year? I can't endorse it specifically but I think the magic words are sqlalchemy and pydantic and that's what this is.

            Link Preview Image
            SQLModel

            SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.

            favicon

            (sqlmodel.tiangolo.com)

            badnetmask@hachyderm.ioB 1 Reply Last reply
            0
            • octarine_wiggle@mastodon.auO octarine_wiggle@mastodon.au

              @badnetmask is this the thing you feel should exist in current year? I can't endorse it specifically but I think the magic words are sqlalchemy and pydantic and that's what this is.

              Link Preview Image
              SQLModel

              SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.

              favicon

              (sqlmodel.tiangolo.com)

              badnetmask@hachyderm.ioB This user is from outside of this forum
              badnetmask@hachyderm.ioB This user is from outside of this forum
              badnetmask@hachyderm.io
              wrote last edited by
              #7

              @octarine_wiggle
              I'll take a look at that. Thanks.

              1 Reply Last reply
              0
              • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

                @glyph @cazabon
                I'll take a look at SQLAlchemy, thanks.

                In essence I have nothing against SQL. I will write if I have to. I just thought after so many years we would be able to abstract that with plain Python statements.

                glyph@mastodon.socialG This user is from outside of this forum
                glyph@mastodon.socialG This user is from outside of this forum
                glyph@mastodon.social
                wrote last edited by
                #8

                @badnetmask @cazabon Any abstraction is necessarily incomplete. The documentation for your database is always going to be in SQL, and you should probably care about the specifics of your database.

                My own attempt to square this circle is https://dbxs.readthedocs.io/en/latest/ β€” with it, you write SQL manually, but it's in a structured and organized way; rather than try to hide the seam between the Python and the database, it carefully arranges that seam so it is all in one place and easy to inspect.

                glyph@mastodon.socialG 1 Reply Last reply
                0
                • glyph@mastodon.socialG glyph@mastodon.social

                  @badnetmask @cazabon Any abstraction is necessarily incomplete. The documentation for your database is always going to be in SQL, and you should probably care about the specifics of your database.

                  My own attempt to square this circle is https://dbxs.readthedocs.io/en/latest/ β€” with it, you write SQL manually, but it's in a structured and organized way; rather than try to hide the seam between the Python and the database, it carefully arranges that seam so it is all in one place and easy to inspect.

                  glyph@mastodon.socialG This user is from outside of this forum
                  glyph@mastodon.socialG This user is from outside of this forum
                  glyph@mastodon.social
                  wrote last edited by
                  #9

                  @badnetmask @cazabon If you give it a try let me know, it hasn't seen a lot of production use yet, but it ought to be very simple πŸ™‚

                  badnetmask@hachyderm.ioB 1 Reply Last reply
                  0
                  • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

                    I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

                    PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

                    #Python #SQLite

                    mdione@en.osm.townM This user is from outside of this forum
                    mdione@en.osm.townM This user is from outside of this forum
                    mdione@en.osm.town
                    wrote last edited by
                    #10

                    @badnetmask is there a language that has an ORM in their std lib?

                    1 Reply Last reply
                    0
                    • glyph@mastodon.socialG glyph@mastodon.social

                      @badnetmask @cazabon If you give it a try let me know, it hasn't seen a lot of production use yet, but it ought to be very simple πŸ™‚

                      badnetmask@hachyderm.ioB This user is from outside of this forum
                      badnetmask@hachyderm.ioB This user is from outside of this forum
                      badnetmask@hachyderm.io
                      wrote last edited by
                      #11

                      @glyph @cazabon
                      Well, in my case it wouldn't be production for sure. πŸ˜„

                      1 Reply Last reply
                      0
                      • badnetmask@hachyderm.ioB badnetmask@hachyderm.io

                        I haven't had to write a Python app that uses a database in a very long time. I thought things were different now. Better, I would hope. But, seriously? Do I still need to write my own SQL statements? What year is that? πŸ™„

                        PS: if someone can suggest a Python library that I can use to manipulate SQLite without writing SQL, I would appreciate it.

                        #Python #SQLite

                        newsgroup@social.vir.groupN This user is from outside of this forum
                        newsgroup@social.vir.groupN This user is from outside of this forum
                        newsgroup@social.vir.group
                        wrote last edited by
                        #12

                        @badnetmask

                        1 Reply Last reply
                        1
                        0
                        • R relay@relay.an.exchange shared this topic
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups