Zegnat / php-mintoken

A minimal IndieAuth compatible Token Endpoint.
BSD Zero Clause License
14 stars 4 forks source link

Explore possibility to be database agnostic #8

Open Zegnat opened 6 years ago

Zegnat commented 6 years ago

While there are a few reasons for why I used an SQLite database as the storage behind Mintoken, it may be possible to let the user setup any PDO connection they want. That way any storage compatible with PDO will be compatible with Mintoken.

A few things to note:

  1. This means the SQLs need to be as globally supported as possible. Is there some standard SQL dialect that should be aimed for?
  2. Are there possible security mismatches between different databases?

As far as 2 goes, look into what the security experts from Paragon are doing in EasyDB.

Zegnat commented 6 years ago

My SQLs are probably simple enough to just use ANSI SQL. Maybe even SQL 92?

This could come in paired with following a style guide.

Zegnat commented 6 years ago

As of The Thoughtful Edition, all SQL should be SQL-92. And the style guide has been loosely applied.

Next up would be switching to a dynamic DSN setting, instead of the SQLite path.