sqlpage / SQLPage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.63k stars 95 forks source link

hash_password() function broken in 0.20.5 #322

Closed lyderic closed 6 months ago

lyderic commented 6 months ago

Introduction

When loading a page with a form to compute a hash, I get an error.

To Reproduce

This is my code:

SELECT 'form' AS component;
SELECT
  'password' AS type,
  'password' AS name;

SELECT 'text' AS component,
  sqlpage.hash_password(:password) AS contents
WHERE :password IS NOT NULL;

Actual behavior

After following these steps, what happened ?

I get the following error:

Error in function call sqlpage.hash_password(:password).
Expected sqlpage.hash_password(password)

I get the following backtrace:

Parameter password: Unexpected NULL value

Screenshots

Screenshot from 2024-05-16 17-17-44

Expected behavior

I expect a behavior such as the one on the example page. I also expect the same behavior as what I get when running the exact same code with sqlpage 0.20.4:

Screenshot from 2024-05-16 17-27-13

Version information

Additional context

This looks like a regression bug in 0.20.5, as the exact same code is fine with 0.20.4.

lovasoa commented 6 months ago

Hello and welcome to SQLPage ! Thank you for reporting this. This bug was introduced by the functions refactoring in 0.20.5 and is fixed in the upcoming 0.20.6 (see the changelog). The easiest way to test the next release today is to use the lovasoa/sqlpage:main image in docker.

And, out of curiosity: what is it that you are building with SQLPage ? Would you be interested in making a small presentation in the community page ?

lyderic commented 6 months ago

Many thanks for coming back to me so swiftly!

I am not a huge docker fan, so I will revert to 0.20.4 for the moment, not a problem.

I am working on two SQLite-backed projects: an SCI manager (SCI stands for 'Société Civile Immobilière', a French company structure for managing properties) and a bookmark manager.

I am still testing sqlpage as a simpler alternative to a more elaborate solution based on go (my language of choice) to put a GUI in front of my SQLite databases.

The bookmark manager is a personal project and I might indeed present it when it's ready. I was looking at a way to contribute, knowing that I am not a rust developer and that my patience with HTML/CSS is limited ;-)

The SCI manager is more elaborate and I am not sure I will end up using sqlpage, as the requirements for security and perennity are higher.

Thanks for sqlpage anyway. This is a very good project!

lovasoa commented 6 months ago

Both your SCI manager and bookmark manager sound very interesting! I hope you'll be able to share them soon!

I understand your concerns about security and maintainability, especially for your more elaborate SCI manager project. Please don't hesitate to reach out if you have any questions or need assistance in these areas!

Even if you're not a Rust developer or a fan of HTML/CSS, your feedback and contributions are incredibly valuable. There are many ways to contribute, from sharing your experiences and suggestions to helping improve documentation. The official website is entirely written in SQL with SQLPage, so everyone can contribute with no more skills required than some SQL and some creativity.

Since you've learned SQLPage recently, you probably have a good idea of what could make the learning experience better and easier, and which areas are confusing or lacking documentation. I'd love to get your feedback on it!

lyderic commented 6 months ago

Thanks. I'll see how to contribute if I can in due course. Cheers! L.

lyderic commented 5 months ago

Hi. Just tested newly release 0.21.0 and I confirm that the issue is fixed. Many thanks!!!

lovasoa commented 5 months ago

Great! Have fun with 0.21. And don't hesitate to get in touch again if you need anything!