David Lord :python: · @davidism
1070 followers · 693 posts · Server mas.to

Flask-SQLAlchemy 3.1.0 released, with support for SQLAlchemy 2's new annotation-based model definition. Thanks to @pamelafox for becoming a maintainer and enabling that support!
github.com/pallets-eco/flask-s
pypi.org/project/Flask-SQLAlch

#sqlalchemy #flask #Python

Last updated 1 year ago

Nicolas FrΓ€nkel · @frankel
865 followers · 1099 posts · Server mastodon.top
Holly Becker · @hwesta
112 followers · 63 posts · Server wandering.shop

Question involving

Currently, we run end-to-end API tests against a sqlite DB, which takes about 2 seconds. I want to switch to postgres (what we use in prod) but that makes the tests take a lot longer, about 12 seconds.

Is there a way to improve this?

What might be causing the slowness? Where can I look? Is it networking to the docker container? Postgres enforcing constraints? Running flush after every DB fixture? Something else?

#python #sqlalchemy #factoryboy #postgresql #pytest

Last updated 1 year ago

Mike Lockhart :veritrek: · @milohax
36 followers · 258 posts · Server hachyderm.io

I really enjoyed this week's awesome livestream with Pamela Fox, showing connecting to database by various ways in VSCode, and .

Covers , , running in a dev container with docker compose and connecting to local and azure DBs, environment management... so many things crammed in an hour!

Also shows of GitHub Copilot a lot, but you don't need it to follow along (I'm going to try it using GitLab Duo).

#vscode #postgresql #python #sqltools #sqlalchemy

Last updated 1 year ago

Ryan Clough · @CiscoJunkie
9 followers · 168 posts · Server techhub.social

Designing a replacement for an internal tool this week, and am picking up for the first time. Using the ORM is forcing me to take an object-oriented approach to this project, despite my brain's protesting. πŸ˜†

#networking #sqlalchemy

Last updated 1 year ago

Ploomber · @ploomber
31 followers · 27 posts · Server fosstodon.org

πŸ“£ New ETL pipeline course module out! Grasp the difference between .pyscript & Jupyter notebooks and master Python script drafting best practices.

Dive into function definitions, modularization, code documentation, and Python script packaging. We also introduce Pandas and DuckDB Python API for efficient data handling. Discover more at

ploomber-sql.readthedocs.io/en

.

#python #datascience #sqlalchemy #pandas #automation #modularization

Last updated 1 year ago

McK · @mck
24 followers · 747 posts · Server uri.life

기쑴에 ν–ˆλ˜ ν”„λ‘œμ νŠΈ v2둜 μ „ν™˜.
```py
id: Mapped[master_id]
slug: Mapped[slug]
name: Mapped[str | None]
```
μ΄λŸ°μ‹μœΌλ‘œ ORM λͺ¨λΈ 클래슀λ₯Ό ꡬ성 ν•  수 μžˆμ–΄μ„œ μ½”λ“œκ°€ ν•œκ²° κΉ”λ”ν•΄μ‘Œλ‹€. 쿼리μͺ½μ€ v1 ν˜•μ‹λ„ κ·ΈλŒ€λ‘œ μ“Έ 수 있고, μ ˆλ§ˆλ‹€ λŠμ–΄μ„œ 미리 ꡬ성해 λ‘˜ μˆ˜λ„ μžˆμ–΄μ„œ 골라먹기 쒋더라.

μ–΄λ”˜μ„ κ°€λŠ” pydantic 클래슀만으둜 λ™μž‘ν•˜λŠ” ORM을 μ§„ν–‰μ€‘μ΄λ˜λ° 잘되면 μ’‹κ² λ‹€.

#sqlalchemy

Last updated 1 year ago

BjΓΆrn Ricks · @bjoernricks
45 followers · 236 posts · Server norden.social

I have to say docs are painful. Very very difficult to find the right information. In contrast docs are a pleasure to read! slqmodel is a thin layer to combine sqlalchemy and pydantic. Thus you need to lookup the touch stuff in the sqlalchemy docs.

#sqlalchemy #sqlmodel

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
417 followers · 2207 posts · Server techhub.social

@lsmith

In memory is also a good option. I like sqlite because there are great tools like which allows you to have features, but if it is simple I would just go with the built-in libraries to improve performance.

I also like sqlite with , as I have the simplicity of a sqlite database, but I can easily share it with containers with mounts and persist the data during development and production.

also has greay extensions for viewing sqlite databases, making it a glorified csv with advanced query capabilities.

#sqlite #sqlalchemy #orm #docker #vscode

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
404 followers · 2154 posts · Server techhub.social

@_alen

I am quite lazy with them and whoch they were more automatically detected, especially for diciotnaries. During development, my dictionaries often change, and I get lazy. Once my code base grows, it is very frustrating to have to go back!

But I have to say, with something liek . Their type hints really make development easier!

#sqlalchemy #python

Last updated 1 year ago

Tim Penhey πŸ‡³πŸ‡Ώ · @thumper
236 followers · 559 posts · Server hachyderm.io

Looking for suggestions, SQLAlchemy says:

Evaluating non-mapped column expression 'run_updates.run_id' onto ORM instances; this is a deprecated use case. Please make use of the actual mapped columns in ORM-evaluated UPDATE / DELETE expressions.

Gathering counts out of band and wanting to update counts of multiple rows at once.

x = Values(...).data(...)

then

update(Table).where(Table.field == x.c.field).values(field2 = Table.field2 + x.c.field2)

ideas?

#python #sqlalchemy

Last updated 1 year ago

Tim Penhey πŸ‡³πŸ‡Ώ · @thumper
235 followers · 547 posts · Server hachyderm.io
stark@techhub.social:~$ β–ˆ · @Stark9837
397 followers · 2111 posts · Server techhub.social

@dozymoe @davidism

To then install the version using ? That would be cool.

#sqlalchemy #python #pip

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
397 followers · 2111 posts · Server techhub.social

@orsinium

I haven't used async and wait with yet. So this will also be a fun way to get into it with . What I like about it is that I could also easily move away from if I need to, and has great support, so I would need to change much.

#python #sqlalchemy #sqlite #PostgreSQL #docker

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
397 followers · 2111 posts · Server techhub.social

@orsinium

I prefer to use something more popular, that the support is better. The docs of are a bit odd. I found myself getting stuck after the tutorial, like you said. It seems 2.0 documentation isn't the best with the new declarative style, but I found some other resources, and I am diving into code I found on to see how others did it.

is cool, but the names like that always turn me off. I need serious names for libraries I use, I don't know. But I can see that it had great influence from modern styles, so it might be better for people coming from that.

Thanks for the info!

#sqlalchemy #github #peewee #js #orm #python

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
397 followers · 2111 posts · Server techhub.social

@setebos

I am aware of the limitations, but I am far below them. I want to project to be easily deployable by others and then the usage will also be low enough for it to suffice.

feels a lot like the web-development that you get for and , but I like , the docs also seem good.

#peewee #orm #react #js #sqlalchemy

Last updated 1 year ago

stark@techhub.social:~$ β–ˆ · @Stark9837
397 followers · 2111 posts · Server techhub.social

What is your favorite for and ? I am currently looking for an ORM judt to sinplify my implementation.

I am considering going for SQLite because the writes and reads are low, and the total size will also be a few 100 records, but I want the strengths of SQL. Also, I am running it in , so it simplifies the deployment.

I am looking at and also saw on .

This is the first time I am doing something like this. Normally, my data is simply printed to CSV files.

#python #orm #sql #sqlite #docker #sqlalchemy #peewee #github

Last updated 1 year ago

gram · @orsinium
76 followers · 263 posts · Server fosstodon.org

@justindz @RethinkJeff Most people use as but it can be hard to grasp sometimes. There are many ways to do the same thing and the documentation is a mess. Still, I don't know other alternatives with as good support for async and typing. Plus, it's popularity means lots of tutorials.

If you still want to try alternatives, I listed some of them here:
t.me/itgram_channel/581

#sqlalchemy #python #orm

Last updated 1 year ago

djundjila · @djundjila
82 followers · 937 posts · Server wetshaving.social

The birth of for and

Developed at gitlab.com/djudges/djudgeporta under the license using , , .

Contributions are not only welcome, but necessary.

If you ever wanted to join a dev project to help the community, this is your chance. Newbies welcome, all you need is the will to read tutorials.

#djudgeportal #lathergames #austereaugust #opensource #apgl #python #flask #sqlalchemy #wetshaving

Last updated 1 year ago