6 ms·
SQLite Plus: Missing SQLite functions
- iagovar 6y agoRelated: https://duckdb.org/ https://duckdb.org/ It's OLAP, not OLTP like SQLite.
- jolux 6y agoDoes OLAP vs OLTP describe a real technological difference or just a description of the use cases a specific tool is trying to address?
- gigatexal 6y agoGenerally OLAP databases are columnar or otherwise optimized for batch and aggregations.
- pm90 6y agoYes it does describe a technological difference. Specifically, the kind of tasks that they are good for. My very crude shorthand is that olap == optimized for time series (usually column oriented) and oltp == optimized for transactional processing (row oriented).
- CharlesW 6y agoThe "description of the uses cases" answer can also be a reasonable shorthand for databases which support both, which allows the DBA to optimize on a table-by-table (and even column-by-column) basis.
- Hahalolomg 6y agoAre you guys % sure about downloading? It said for me haha you now have a virus and then it logged me out of my phone for 6 minutes, I was like why did they do that. Please do not download this GitHub app!!!
- runningmike 6y ago...
- Hahalolomg 6y agoHi
- brandmeyer 6y agoIf a table is constructed WITHOUT ROWID, then its spatial locality will reflect the consecutive order implied by the primary key. Range-delimited queries are extremely fast. In effect, SQLite already is both an OLTP and OLAP database.
- sanxiyn 6y agoAs you pointed out, SQLite does implement clustered index, but it is not columnar.
- chunkyks 6y agoI'm still just absurdly happy that it now has a bunch of math functions in the latest release: https://sqlite.org/lang_mathfunc.html https://sqlite.org/lang_mathfunc.html
- dvfjsdhgfv 6y agoOut of curiosity: what is your use case and why do you prefer to use them in the DB instead of the application itself?
- smitty1e 6y agoIf you can put the logic into the SQL and filter some data out, that's likely to be a performance win. Whether the team benefits from tarting up the SQL beyond SELECT * is worth examining, however.
- sitkack 6y agoSo you can filter and join on computed values. What if there is no application?
- dvfjsdhgfv 6y agoI never thought about this - how would you present the data to the user then if there's no application?
- happysadpanda2 6y agoThe "DB" guy at my workplace is regularly asked about certain stats from the production db, he runs some query, dumps it in a csv-formatted file and mails that to whoever asked for it.
- chunkyks 6y agoGenerally I like to be able to ask questions of my database directly in a sql editor window. There's all sorts of cases where that is useful.
- yawaramin 6y agoThis is a really good idea. I'm using SQLCipher right now but might swiitch over as I don't really use the encryption feature.
- wayneftw 6y agoAfter CSV files as virtual tables, I'd like to see folders of JSON files as virtual tables. I know there's a whole virtual filesystem kit based around SQLite but what I want is simpler.
- foepys 6y agoI don't think that a folder full of JSON files is actually simpler. There are SQLite drivers for nearly every language out there and querying SQLite is not only very easy and fast but it's also all contained in a single file you can copy around. What do you want to gain by using JSON files specifically? Unless you want a document database but then SQLite is the wrong kind of tool anyways.
- wcarss 6y agoI read it as "I already have or can easily get a folder of JSON files (each representing a table); I want to open them up in SQLite with nearly zero effort." That should be hackable with something like json2csv[1], but I imagine the intent is a desire for something supported, rather than awfully hacked up. 1 - https://github.com/zemirco/json2csv https://github.com/zemirco/json2csv
- foepys 6y agoThat makes way more sense. GGP is probably meaning exactly that, specifically vsv from the OP that I missed initially. https://github.com/nalgeon/sqlite-plus/blob/main/docs/vsv.md https://github.com/nalgeon/sqlite-plus/blob/main/docs/vsv.md
- willvarfar 6y agoNot poster, but also often have large numbers of json-ld files. Json events are really common, and saving events to files is really common, and wanting to query them is also common.
- slt2021 6y agomaybe storing files in mongodb instead of a filesystem can be solution?
- daitangio 6y agoTake also a look at https://github.com/daitangio/sqlite_ora_functions https://github.com/daitangio/sqlite_ora_functions A similar project python-based
- tyingq 6y agoSQLite doesn't compile it in by default, but there is a virtual table CSV implementation in the ./ext folder: https://www.sqlite.org/src/artifact?ci=trunk&filename=ext/misc/csv.c https://www.sqlite.org/src/artifact?ci=trunk&filename=ext/mi... Similar for regex: https://sqlite.org/src/file?name=ext/misc/regexp.c&ci=trunk https://sqlite.org/src/file?name=ext/misc/regexp.c&ci=trunk And percentiles: https://sqlite.org/src/file?name=ext/misc/percentile.c&ci=trunk https://sqlite.org/src/file?name=ext/misc/percentile.c&ci=tr...
- pdimitar 6y agoHow are these enabled if they are already compiled in? Or are they automatically enabled if they are compiled in?
- foxhop 6y agoThe official binary build process flags them off, likely.
- deleted 6y ago[deleted]
- smitty1e 6y agoThe VSV extension has additional arguments that may be useful in some situations: https://github.com/nalgeon/sqlite-plus/blob/main/docs/vsv.md https://github.com/nalgeon/sqlite-plus/blob/main/docs/vsv.md
- mutagen 6y agoThere's also https://cgsql.dev/ https://cgsql.dev/ This allows for stored procedures in a T-SQL variant that gets compiled to C. It is on my list to check out but I don't have any experience with it yet.
- dreix 6y agoA libicu free Unicode extension. First time I hear about that and just yesterday I was slightly bothered by the prospect of compiling sqlite with icu again. Thank you to whoever wrote the extension, I'll try it out soon.
- deleted 6y ago[deleted]
- zoomablemind 6y agoWithout a comprehensive test suite, this set of extension libraries is rather a black box. Sure, one can look over the actual code to make sense if the functions do what they should, but one of main SQLite's features is its in-depth testing. It'd be nice to have the same testing approach extended to this set of utilities.
- josteink 6y agoFor me, the one thing I need to plug SQLite in at work us right outer join. Kinda disappointed this doesn’t fix that.
- rgovostes 6y agoSome time ago I joined a project that was recording data logs in Protobuf format. I demonstrated that we could log the serialized Protobuf structures to a SQLite database and then use a plugin to query across the message fields: https://github.com/rgov/sqlite_protobuf https://github.com/rgov/sqlite_protobuf Learning how to use the SQLite extension API was a little mind-expanding but it worked like a charm.
- mikepurvis 6y agoI attempted something similar with large rosbag files, but the performance gain wasn’t enough to make the initial processing worth it. That said, I’d like to try again with duckdb as that seems like it might be better suited to time series analysis.
- liuliu 6y agoFlatbuffers would be better as it doesn't need to deserialize at all (I think protobuf supports to partially deserialization nowadays?). I did something similar with https://github.com/liuliu/dflat https://github.com/liuliu/dflat too!
- skissane 6y agoOne of the things I really like about SQLite is the fact that it is in the public domain. But most third-party extensions, like this one, aren't. (This extension is MIT licensed.) If you think SQLite being in the public domain is a positive, then that's a positive these extensions lack. (Or a public domain near-equivalent license like Unlicense or CC0, which contains an ultra-permissive copyright license for those jurisdictions which don't allow one to voluntarily put stuff in the public domain.)
- BorisTheBrave 6y agoMIT is already an extremely permissive license. Seems kinda mean to complain that something is merely 90% good because you are comparing to something 99% good. What sort of problems do you envisage having with an MIT license that public domain would fix?
- skissane 6y agoSo, if you include N different MIT-licensed libraries in your app, you have to remember to ship N different third party copyright licenses in your binary (or documentation shipping with the binary). And you need to keep an eye out if they change – if you add or remove a third party library, or if a third party library adds the name of a new contributor to its copyright notice in a newer version. It gets even worse when you consider that there are MIT-like licenses, which can have fundamentally the same terms as MIT, but with slightly different wording. Then you can have to ship multiple variant license texts too. Public domain (and public domain-equivalent licenses) you don't have to worry about this, because there is no requirement to include copyright notices or copy of license text. I'm not saying you shouldn't credit people whose contributions you use, but you can make that a non-legal expectation of courtesy rather than a make-work legal requirement.
- otachack 6y agoAfter reading SQLite's page on their public domain approach they seem to go through great lengths to make sure it stays public domain. https://sqlite.org/copyright.html https://sqlite.org/copyright.html Including having their closed contributors sign affidavits and stored in a physical location. This may be what OP is referring to. Compare that with an MIT license with no "hardening" like affidavits so that it's easy to mutate to another license type, I can see their point. Interesting stuff since I never knew this "public domain" approach before!