finanalyst / grav-plugin-sqlite Goto Github PK
View Code? Open in Web Editor NEWPlugin for GRAV CMS to interface with sqlite3 database
License: MIT License
Plugin for GRAV CMS to interface with sqlite3 database
License: MIT License
Setting the id
parameter on the shortcode is not working.
e.g.
[sql-table id=foo]
...
[/sql-table]
The above should result in setting the id
attribute on the table to foo
- but instead no id
attribute is present in the output.
As per your examples, one is allowed to insert carriage returns within the SQL stanza in order to make it more readable.
Unfortunately the plugin reports an error when doing so.
Best,
Stephen
After GPM-installation all pages were deleted and new pages made were imediatelly deleted too.
Im wondering if there is a way to submit the form, without redirecting to a new page?
I think it would require an ajax submit, and "preventDefault" call within a function. Ive tried a few ways so far, but if there are any suggestions how this could be done (if it can) that would be great.
Im thinking of adding a page variable that would control this (I think this would be most useful).
The forms plugin has a multiple forms format.
I have been trying to use this format with this plugin with no success - is there a specific way to do this?
Does it support multiple forms in the blueprint?
Thanks in advance.
Hello,
I would like to ask you to make a simple skeleton which utilizes SQLite plugin as an example, or an explanation as to how to edit specific table row.
For example,
a table in which every row has edit button, and when it is pressed it opens corresponding row according to it's id(row-id?) to be edited.
Thank You in advance!
Nice plugin and great possibilities!!
Is it possible to extend the documentation with an example Form Action sql-select
(create a form which will generate a SELECT statement, based on values from the form and displaying the result of this SELECT)?
Thnx!
This plugin allows us to disable [sql-table]
shortcode select queries per page or to globally enable them.
Since editors can edit page headers, it would be nice to prevent them from running queries at all from page markdown.
I don't think it's a gaping security problem (as long as you trust your editors), but it seems a logical extension to the settings already available.
i needed to install php-sqlite3 for the plugin to work
ie: sudo apt install php-sqlite3 & sudo service apache2 restart
Hello,
I would like to ask you if it's possible to fetch all table rows and list them on a page by somehow looping trough them, and when we press button "Edit" on any of those items, to get correct row by it's ID to be changed? If so, how can I accomplish that? ๐ฏ ๐ :)
It yould be a pretty nice small alternative to some web app functionalities..
Thank you!
Hi,
Thank you for the plugin which is very useful to bridge a lot of gaps!
I am having an issue though.
NB. I am using the chinook
database which is provided as a test database by SQLite
I am trying to include a front matter variable in the stanza, so that I may have a different one for each page.
Here is the code for the page:
---
title: 'Test Database'
template: places
database:
query: "Smith"
shortcode-core:
active: true
cache-enabled: false
process:
twig: true
---
Query String: <strong>{{page.header.database.query}}</strong>
[sql-table]
SELECT trackid, name, composer, milliseconds FROM tracks WHERE composer LIKE "{{page.header.database.query}}" ORDER BY trackid ASC LIMIT 10;
[/sql-table]
The outcome is that the query string Smith
is well recognized on the page but is NOT within the stanza: it is left empty there. As a result the SQL query is executed on an empty string instead of Smith
and yields no result. Have a look at the attached screenshot.
Please help.
Best,
Stephen
Hi, I don't particularly want to take this plugin over, but it's been some time since the owner @finanalyst has responded to some issues or my PR, so I need to politely check if it is being maintained in accordance with the Abandoned Resource Protocol.
I have several other improvements in local branches I'd also like to have considered for official integration.
Really appreciating the plugin, BTW :) Thank you for building it.
Cheers
php7.4-common broken on Debian Buster, php7.4-sqlite3 is not possible install in to the system...
I'm experiencing runtime errors ("Crikey!") in two slightly different situations which I suspect may be solved in a single change to the codebase.
The error is: "Undefined property: stdClass::$sqliteSelect" and is being thrown at line 71 of sqlite.php.
In both cases, I have extra_security
enabled and the errors do not happen when it is disabled,
sqliteSelect
header will generate this error when extra_security
is on. It can be reproduced simply by toggling those two headers in the page and in the plugin config respectively. This is a problem because the header has no other possible listed value, although if I change it to an arbitrary value ("foo") the error does not happen.sqliteSelect
is provided on the page. I think this is because the page is redirected and the login page does not have this header (as per the first case above). Presumably, this will happen wherever Grav redirects are in effect.I am pretty sure both causes can be circumvented simply by testing for the header's existence in line #71 before testing its value. However, there may be a better way to exclude redirected pages from executing this code at all.
I am happy to provide a basic patch if you don't have time to fix this promptly, as it may hold me up otherwise. Just thought I'd better give you the chance to handle the redirect scenario more elegantly if you know a way :) Let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.