Closed prjseal closed 1 year ago
@prjseal Thanks for raising this. Unfortunately, I haven't got around to implementing the SQLite provider yet 😢 (I left a code comment about it, but I should have put it in the README's Known Issues - doh!)
I'll need to figure out how to handle SQLite with a multi-targeted package. 😬
Ah that makes sense now. I was able to get around this by implementing my own custom data list source which calls my repository service that uses NPoco.
Hi!
I have not looked into any details around this specific issue but I wanted to share some of the experience of making sure my email package works on both SQL Server and SqlLite.
My initial idea was to create some kind of abstraction over the DB but before I did that I tried to see if would be possible to just "translate" the "SQL Server"-SQL into "SqlLite"-SQL, by making sure that types in my db-queries were correct and so on. In my case, this works great but I guess it all depends on the specific use case. Anyway, I figured I'll share the code here:
https://gist.github.com/enkelmedia/d4a19f797d9ee1ff8bd4cfbd4589b783
The basic idea is that you run your string representation of your SQL query via this method and then get back a query that would work on SqlLite. I do know that this is far from optimized in terms of memory etc. but it does solve the problem and I have and it might work as an inspiration (maybe =D). I'm also sure that this does not cover every possible use case and query, just the basic ones that I had.
I understand if this approach is too specific for my use case but I wanted to share the pragmatic approach that I took for quite a big package. There is always the option for custom data sources and so one which might be a better recommendation in this scenario.
I would be happy to share more details about the code or "formalize" it if this is interesting but wanted to start by showing the basic idea.
All the best! and look forward to seeing you att CodeGarden 2023, Kee thanks again for a great package!
Good news, I hopefully have fixed this in PR #356! 🙌
Closing this ticket. It'll be part of the next patch release, (date unknown, soon-ish, week or two-ish).
Which Contentment version are you using?
4.1.5
Which Umbraco version are you using? For example: 8.14.1 - don't just write v8
10.2.0
Bug summary
When trying to use the Data List SQL Data Source an error is thrown, complaining about Keyword not supported: 'cache'.
Full Stacktrace:
Steps to reproduce
Use this script to install the right version of Umbraco with the right version of Contentment.
https://psw.codeshare.co.uk/?InstallUmbracoTemplate=true&UmbracoTemplateVersion=10.2.0&Packages=Our.Umbraco.Community.Contentment%7C4.1.5&UserEmail=admin%40example.com&ProjectName=MyProject&CreateSolutionFile=true&SolutionName=MySolution&UseUnattendedInstall=true&DatabaseType=SQLite&UserPassword=1234567890&UserFriendlyName=Administrator&IncludeStarterKit=true&StarterKitPackage=clean
Create a new Data Type which uses the Contentment Data List.
Choose the SQL Data Source.
Leave it to be the default query
Choose buttons or dropdown for the editor, or anything really.
See the error.
Expected result / actual result
I expected the query to be able to execute properly and return results to the property.
Do you have Umbraco ModelsBuilder enabled?
What browsers are you seeing the problem on?
Chrome