lanterndata / lantern

PostgreSQL vector database extension for building AI applications
https://lantern.dev
GNU Affero General Public License v3.0
790 stars 57 forks source link

Improve dev workflow and add SQL code formatter #72

Closed dqii closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Merging #72 (ff05df8) into main (b7e0e58) will decrease coverage by 0.09%. Report is 4 commits behind head on main. The diff coverage is n/a.

:exclamation: Current head ff05df8 differs from pull request most recent head f0a7695. Consider uploading reports for the commit f0a7695 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #72 +/- ## ========================================== - Coverage 83.10% 83.02% -0.09% ========================================== Files 11 11 Lines 876 854 -22 Branches 165 161 -4 ========================================== - Hits 728 709 -19 + Misses 67 66 -1 + Partials 81 79 -2 ``` [see 2 files with indirect coverage changes](https://app.codecov.io/gh/lanterndata/lanterndb/pull/72/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lanterndata)
dqii commented 1 year ago

Update

pgFormatter doesn't support magic comment ignores well. (It keeps adding a space to the next line, for example). In addition, it doesn't support CTEs well either (multiple Github issues about this).

I tried out pglast, which is based on libpg_query, which uses Postgres's parser. This handles all the Postgres SQL and pl/pgSQL corner cases nicely, but unfortunately doesn't handle the psql metacommands (e.g., \set \eqcho \copy)