sqlpage.run_sql is just great 👏
#301
matthewlarkin
started this conversation in
Show and tell
Replies: 2 comments 6 replies
-
|
Thanks, @matthewlarkin! It's refreshing to read a post like yours, sharing knowledge and appreciation. Typically, people only speak up when they have an issue, so thanks for being an exception! @DSMejantel, I think you've got a similar user management system in place, so I figure you might find these tips useful 😉 |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Thank you very much for these great examples. Such contributions would be something for HowTo's in the documentation |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey SQLPagers,
Just came by to show my appreciation for the new
sqlpage.run_sqlfunction for it's help with reusability making my code more readable. In particular, I've enjoyed using it lately to set global variables and filters.Global variables
Set global variables at the top to help you write more readable code, obscuring complexity in separate SQL files.
Subsequent
.run_sqlfunctions and of course the rest of the current sql file now have access to$user. 🙌Filters
The example above assumes we have a logged in user. So we can easily use a filter to redirect non-logged-in guests since
.run_sqlinherits our$uservariable 💪I'd love to see how others are making use of the
.run_sqlfunction!Great job @lovasoa!
Beta Was this translation helpful? Give feedback.
All reactions