Meta Question: How can we make db<>fiddle (and integration here) better?
[db<>fiddle](https://dbfiddle.uk) was designed with markdown-based Q&A in mind, so it seems sensible to use a post here for comments/suggestions/bug reports.
Please feel free to comment in the chat room attached to this post.
**Please post concrete feature requests and bug reports as answers below.** Please also post any feature requests and bug reports about db<>fiddle integration with TopAnswers.
The current list of supported databases is:
* SQL Server 2012, 2014, 2016, 2017, 2017 Linux, 2019 and 2019 Linux RC1
* Postgres 8.4, 9.4, 9.5, 9.6, 10, 11 and 12
* Oracle 11.2 and 18
* MySQL 5.6, 5.7 and 8.0
* MariaDB 10.2, 10.3 and 10.4
* SQLite 3.8, 3.16 and 3.27 (but 3.16 is currently offline for [security reasons](https://security-tracker.debian.org/tracker/CVE-2018-20346))
* Db2 Developer-C 11.1 (with lots of thanks to [@mustaccio](https://dba.meta.stackexchange.com/users/23721/mustaccio))
* Firebird 3.0
Here's an example (the image links to the fiddle):
[![SQL Server 2019 'help'](/image?hash=407870c3b82d22484cb884d64c05e7a70ca3f3e97cd776b4f82cf701a55e56a3)
and here's a really interesting one just for fun:
[![Naughts and Crosses](/image?hash=91efa2c2370e503e4158d295924693af7ce4f9eb25d8435126c2fcbb87e690fd)](https://dbfiddle.uk/?rdbms=postgres_11&fiddle=71940aadda50f55bfede87606cd1dc2c)
finally, just because we can, here is the same fiddle integrated into this post. You can edit it and run it live right here:
## YYYY-MM-DD for SQL Server
It looks like SQL Server is the only non-ISO localisation at the moment, but I've embedded a few of my favourites below for ongoing reference.
Using Windows 10.0.17763 and Google Chrome 79.0.3495.
Steps to reproduce:
Browse to dbfiddle.uk, change query to 'SELECT 1' and click 'run'.
Default engine is SQL Server 2019 and the URL reflects this correctly: https://dbfiddle.uk/***?rdbms=sqlserver_2019***&fiddle=<something>
Change database selection to PostgreSQL 12 (or any other), change query to 'SELECT 2' and click 'run'.
URL now reflects correct engine https://dbfiddle.uk/***?rdbms=postgres_12***&fiddle=<something>
Click browser 'Back' button.
query is correctly reverted to 'SELECT 1' and previous result is shown. URL shows https://dbfiddle.uk/***?rdbms=sqlserver_2019***&fiddle=<something>
However, menu selection remains in 'Postgres 12', and clicking 'Run' again changes the URL back to 'Postgres 12'.
page should respect URL specification and clicking 'Back' should switch back not only the query, but also the database selection.
Bug or feature?
Thanks again for this amazing service Jack!
# User cookies
When I was a SQL Server Man™️ I appreciated that db<>fiddle launches by default to a recent SQL Server `@@version`.
Now that I'm mainly a PostgreSQL Comrade, I kind of wish it would launch to PostgreSQL.
Does it make sense to add an (opt-in) tracking cookie to remember the last platform a user was on? Perhaps even integrating with an topanswers profile if available?
This seems like it could be early-stages groundwork for tracking your own specific fiddle history as well, though; so I suppose it could a mixed bag as to how you feel about that as a concept (whether it's a feature or an imposition).
## CockroachDB integration
The [19.2 release] makes it look like integrating CockroachDB to db<>fiddle might be relatively easy. Would you be interested in adding CockroachDB as a supported platform?
The [`cockroach demo`] command ostensibly provides an ephemeral in-memory enterprise instance; and having seen it in action it appears to do what it says on the tin :)
> **Update Nov 21 '19** - CockroachDB licensing reps have confirmed privately that db<>fiddle is within the acceptable usage of `demo`. Docs have been sent to @Jack for records keeping.
~Consolidated~ ~from~ [~here~] ~for~ ~tracking.~
# Embedded fiddles should respect `&hide=` args
I'm drafting through https://topanswers.xyz/databases?q=424 and part of my reproduction includes loading ~60,000 rows of data. In the link as written...
...the trailer arg `&hide=2` collapses the batch where I do the load. In the current embed though, the hidden batch is revealed.
The current fiddle has 5,000 rows (loading the 1k batches from copy-paste is rather taxing on my browser). I'll wait update the fiddle with the remaining rows for the time being 🙂
Currently it looks like editing and/or running the fiddle from the embed doesn't change the post. This is obviously good design, but I suggest adding an `Update this post` button or something similar alongside the embedding. This would make it clear to the user that the underlying post may need to be modified if they want it to persist the changes they have just typed
Some related thoughts:
* Button could hotlink to the `/edit` analogue with the commit message pre-populated à la "_updated fiddle from `abc` to `def`_"
* Perhaps the button only appears on-edit or on-run when a new fiddle hash is generated?
* Does it make sense to track a fiddle's "lineage" & possibly expose it to users to "_go back to that one edit I forgot what I did on but I know what the results looked like_"
* Is there a not-gross way to expose the diff of either the post batch or the last-run batch to the active editor in the embed?