wp-sqlite-db
SQLAlchemy
Our great sponsors
wp-sqlite-db | SQLAlchemy | |
---|---|---|
10 | 123 | |
532 | 8,750 | |
- | 3.3% | |
0.0 | 9.7 | |
2 months ago | 5 days ago | |
PHP | Python | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wp-sqlite-db
-
WordPress Core to start using SQLite Database
Before they added SQLite as WP plugin, I would use https://github.com/aaemnnosttv/wp-sqlite-db/ and I would use `define('DB_DIR', '/absolute/custom/path/to/directory/for/sqlite/database/file/');` to define the database location of my choice; I believe they would let users do the same with core support.
-
WordPress to support SQLite back end
They basically took this implementation and just adapted it to coding standards:
https://github.com/aaemnnosttv/wp-sqlite-db
This has been around since some time and is itself a fork of a previous work.
The interesting part is that this drop-in replacement (mostly) already works well, there are a few issues that are related to some quirks in the WordPress core itself, for example: https://github.com/aaemnnosttv/wp-sqlite-db/issues/18
And maybe now they will be fixed.
- WordPress testing official SQLite Support
-
WordPress WASM
Author here, here's an in-depth writeup on how this works and why it's useful:
https://make.wordpress.org/core/2022/09/23/client-side-webas...
To answer your questions directly:
WebAssembly is the magic sauce that transforms server-side code into client-side code. MySQL unfortunately is not yet supported by WebAssembly, so I applied a plugin that adds SQLite supports to WordPress [0]. The WebAssembly application has its own in-memory filesystem that lives in a specific browser tab and is scraped as soon as you close it.
So – technically it exposes db credentials, and even the entire DB, but that you are the only user of that DB so it's okay.
> What would the backend look like
The only backend is a static file server where the code and the database live. Your browser downloads a copy of the database and allows you to modify it in the current tab, but the updates are never saved back to the server.
[0] https://github.com/aaemnnosttv/wp-sqlite-db
-
A proposal to officially support SQLite in WordPress
1. Plugins that register their own database tables (however there already exists prior art such as https://github.com/aaemnnosttv/wp-sqlite-db for handling these cases)
2. Plugins that do direct queries against the standard database schema (broadly either for invalid (bad code) or performance (valid but slim use case) reasons)
Also, WordPress would of course keep the old query functions around and they would likely add a tag to the plugin repository so authors can mark plugins as supporting thes new ORM features.
Great idea in my opinion!
-
SQLite or PostgreSQL? It's Complicated
There's a WordPress plugin that adds support for SQLite as an alternative to MySQL.
Apparently it works really well. The implementation is (to my) simply astonishing: they run regular expressions against the SQL to convert it from MySQL dialect to SQLite! https://github.com/aaemnnosttv/wp-sqlite-db/blob/9a5604cce13...
- Wp-SQLite: WordPress running on an SQLite database
-
Lots of blocked attacks and probes..should I worry..
This wp-sqlite-db one. Not super active, but maintained, at least.
SQLAlchemy
-
Xz/liblzma: Bash-stage Obfuscation Explained
OK -
can we start considering binary files committed to a repo, even as data for tests, to be a huge red flag, and that the binary files themselves should instead be generated at testing time by source code that's stated as reviewable cleartext. This would make it much harder (though of course we can never really say "impossible") to embed a substantial payload in this way.
when binary files are part of a test suite, they are typically trying to illustrate some element of the program being tested, in this case a file that was incorrectly xz-encoded. Binary files like these weren't typed by hand, they will always ultimately come from something plaintext source.
Here's an example! My own SQLAlchemy repository has a few binary files in it! https://github.com/sqlalchemy/sqlalchemy/blob/main/test/bina... oh noes. Why are those files there? well in this case I just wanted to test that I can send large binary BLOBs into the database driver and I was lazy. This is actually pretty dumb, the two binary files here add 35K of useless crap to the source, and I could just as easily generate this binary data on the fly using a two liner that spits out random bytes. Anyone could see that two liner and know that it isn't embedding a malicious payload.
If I wanted to generate a poorly formed .xz file, I'd illustrate source code that generates random data, runs it through .xz, then applies "corruption" to it, like zeroing out the high bit of every byte. The process by which this occurs would be all reviewable in source code.
-
Introducing Flama for Robust Machine Learning APIs
Besides, flama also provides support for SQL databases via SQLAlchemy, an SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. Finally, flama also provides support for HTTP clients to perform requests via httpx, a next generation HTTP client for Python.
-
Alembic with Async SQLAlchemy
Alembic is a lightweight database migration tool for usage with SQLAlchemy. The term migration can be a little misleading, because in this context it doesn't mean to migrate to a different database in the sense of using a different version or a different type of database. In this context, migration refers to changes to the database schema: add a new column to a table, modify the type of an existing column, create a new index, etc..
- Imperative vs. Declarative mapping style in Domain Driven Design project
-
Unlocking efficient authZ with Cerbos’ Query Plan
To simplify this process, Cerbos developers have come up with adapters for popular Object-Relational Mapping (ORM) frameworks. You can check out for more details on the query plan repo - which also contains adapters for Prisma and SQLAlchemy - as well as a fully functioning application using Mongoose as its ORM.
-
Python: Just Write SQL
That above pattern is one I've seen people do even recently, using the "select().c" attribute which from very early versions of SQLAlchemy is defined as "the columns from a subquery of the SELECT" ; this usage began raising deprecation warnings in 1.4 and is fully removed in 2.0 as it was a remnant of a much earlier version of SQLAlchemy. it will do exactly as you say, "make a subquery for each filter condition".
the moment you see SQLAlchemy doing something you see that seems "asinine", send an example to https://github.com/sqlalchemy/sqlalchemy/discussions and I will clarify what's going on, correct the usage so that the query you have is what you expect, and quite often we will add new warnings or documentation when we see people doing things we didn't anticipate.
-
A steering council note about making the global
The creator and lead maintainer of SQLAlchemy, one of the most popular and most used Python library for accessing databases (who doesn't?) gave a rather interesting response to PEP703.
If this doesn't ring any alarm bells I don't know what will.
> Basically for the moment the GIL-less idea would likely be burdensome for us and the fact that it's only an "option" seems to strongly imply major compatibility issues that we would not prefer.
https://github.com/sqlalchemy/sqlalchemy/discussions/10002#d...
-
More public SQL-queryable databases?
Recently I discovered BigQuery public datasets - just over 200 datasets available for directly querying via SQL. I think this is a great thing! I can connect these direct to an analytics platform (we use Apache Superset which uses Python SQLAlchemy under the hood) for example and just start dashboarding.
-
How useful is Python in accounting and auditing?
When using python with sql databases like postgres or mariadb or SQLite you would use SQLAlchemy or another ORM of if you're feeling brave, you code it by hand. With ORMs you provide the address of your database and it connects for you, letting you use abstractions instead of writing all the SQL yourself (kind of analogous to using vlookups or index match instead of manually entering data).
-
Day 46-47: Beginner FastAPI Series - Part 3
Our tool we're going to be using for interfacing with the SQLite database is SQLAlchemy, a SQL toolkit that provides a unified API for various relational databases. If you installed FastAPI with pip install "fastapi[all]", SQLAlchemy is already part of your setup. but if you opted for FastAPI alone, you would need to install SQLAlchemy separately with pip install sqlalchemy.
What are some alternatives?
sql.js-httpvfs - Hosting read-only SQLite databases on static file hosters like Github Pages
tortoise-orm - Familiar asyncio ORM for python, built with relations in mind
wp2static - WordPress static site generator for security, performance and cost benefits
PonyORM - Pony Object Relational Mapper
WordPress - WordPress, Git-ified. This repository is just a mirror of the WordPress subversion repository. Please do not send pull requests. Submit pull requests to https://github.com/WordPress/wordpress-develop and patches to https://core.trac.wordpress.org/ instead.
Peewee - a small, expressive orm -- supports postgresql, mysql, sqlite and cockroachdb
slonik - A Node.js PostgreSQL client with runtime and build time type safety, and composable SQL.
Orator - The Orator ORM provides a simple yet beautiful ActiveRecord implementation.
wordpress-playground - Run WordPress in the browser via WebAssembly PHP
prisma-client-py - Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
trellis - WordPress LEMP stack with PHP 8.1, Composer, WP-CLI and more
pyDAL - A pure Python Database Abstraction Layer