TopAnswers
or
Meta Question: How can we make db<>fiddle (and integration here) better?
Jack DouglasCC0 1.0
[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)
](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=9bcd60e2bcd7966fc3be475addab8eb2)

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:

<>https://dbfiddle.uk/?rdbms=postgres_11&fiddle=71940aadda50f55bfede87606cd1dc2c
Top Answer
CC BY-SA 4.0PeterVandivier
`bug` `fixed`

---

## YYYY-MM-DD for SQL Server

![](https://imgs.xkcd.com/comics/iso_8601.png)

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.

<>https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=b5aa1e2bb74237fde0de2c5ccb632c98

<>https://dbfiddle.uk/?rdbms=postgres_12&fiddle=a9e479467e8185aaf4e8f6eeff753dbc

<>https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=47edd2b88c652aa72de5e000ae288216

<>https://dbfiddle.uk/?rdbms=sqlite_3.27&fiddle=2f53a982cb229c7959b73bf014848091
Answer #2
CC BY-SA 4.0Ami
Hi,

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'.

Expected result:
----------------
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!

Ami Levin
Answer #3
CC BY-SA 4.0PeterVandivier
# 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).
Answer #4
CC BY-SA 4.0PeterVandivier
## CockroachDB integration

The [19.2 release][2] 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`][1] 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 :)

[1]: https://www.cockroachlabs.com/docs/dev/cockroach-demo.html
[2]: https://www.cockroachlabs.com/blog/cockroachdb-19dot2-release/
---

> **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~][3] ~for~ ~tracking.~
 
[3]: https://dba.meta.stackexchange.com/a/3285/68127
Answer #5
CC BY-SA 4.0PeterVandivier
# 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... 

* https://dbfiddle.uk/?rdbms=sqlserver_2017&fiddle=4726813c2d4d6c23fd5d7a50756de4b6&hide=2

...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 🙂
Answer #6
CC BY-SA 4.0PeterVandivier
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?
Andriy M
Adding 30+ seconds increments the minutes because the result is rounded up
PeterVandivier replying to Andriy M
sorry for the confusion - i was interpretting the db<>fiddle handling as some crazy patch i hadn't heard about where `smalldatetime` is now storing seconds
PeterVandivier
the link to the 2017 fiddle i posted _would have shown_ the behaviour you and i both expect (and that we both screencapped) - except for i re-ran it and blew out the cached results
PeterVandivier
so either the db<>fiddle backend is doing something very funny to `smalldatetime` all of a sudden or there's an even more shocking unannounced & undocumented change to that datatype
PeterVandivier replying to Andriy M
i got the same results as you in my local test screencap ![](https://topanswers.xyz/image?hash=692d1ca9e1fdea017bcdedfc45e94181809afd3f9fca11fb6db90b55cdff86d2)
Jack Douglas replying to PeterVandivier
no, 'fraid not
PeterVandivier replying to Jack Douglas
well if you'll take my word for it, the 2017 fiddle link used to show the same as both mine & @Andriy 's screencaps
PeterVandivier
so... possibly a regression?
PeterVandivier
can't imagine what would cause that though 🤷‍♂️
Jack Douglas
`ALTER DATABASE CURRENT SET ALLOW_SNAPSHOT_ISOLATION ON`
Jack Douglas
could that explain the difference?
Jack Douglas
or one of:
Jack Douglas
`SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON`
Jack Douglas
`SET NUMERIC_ROUNDABORT OFF`
Jack Douglas replying to PeterVandivier
sure it wasn't 2012? https://dbfiddle.uk/?rdbms=sqlserver_2012&fiddle=54e7638b4a855a439c4b9ebecee8a37a
PeterVandivier replying to Jack Douglas
as sure as i can be, that's what i linked to on [that dba.se comment](https://dba.stackexchange.com/questions/160709/datetime20-vs-datetime22/160713#comment491533_160713)
PeterVandivier replying to Jack Douglas
i can't see any of those possibly being the cause. but who knows
PeterVandivier
like i said though - i'll try and patch & check again on my other laptop (tomorrow probably). if i can't repro there, then i'm guess it's a bizarre internal regression
PeterVandivier
if i can't then somehow MS snuck in bonus data density in a CU and didn't tell anyone
PeterVandivier
but that seems unlikely :-p
Andriy M replying to Jack Douglas
Actually... there's [something severely wrong](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=f9dbc388e0d0fdf4cf2ade4f806d7611) with dbfiddle's datetime handling at the moment. Why does it show the current time in each case?
PeterVandivier
😱
PeterVandivier
i wonder if the change on the dotnet typing is assigning the current time from the app driver instead of bringing back the value from the DB
Jack Douglas replying to Andriy M
you are a genius @Andriy 
Jack Douglas
I think it is all fixed up and working the way you expect now
Jack Douglas
I've truncated the seconds from `smalldatetime` as they are now correctly always 0
Jack Douglas
cc @PeterVandivier 
fds
Hi Jack! All that's left is to say thank you again, I believe. Came here to repeat my issue with Firebird LIST() as instructed, but then I see it's already fixed. :) Haha, and just yesterday I spent a good chunk of time registering on dba.se, then building up the sufficient "reputation" only so I could post that bug report. It was worth it, of course, in the end, but maybe this is then my new bug report: the suggestion/reports link should be updated on the dbfiddle site to point here.
Jack Douglas replying to fds
Hi @fds and thanks for dropping in — yes I managed to fix the bug thanks to [this faq page](http://www.firebirdfaq.org/faq250/) I found!
Jack Douglas
Also thanks for letting me know there is a db<>fiddle link still pointing to dba.se — did you get there on mobile by any chance? The desktop link already points here!
fds
Not on mobile, Mac laptop Apple Safari, but it very well might be mistaking that for mobile. Now I'm wondering what the "real" site is supposed to look like. Everything still functioned fine. I see like a play button / hamburger menu, click on it, and up pops a menu containing "comments/suggestions/bugs." That's what lead me to dba.se.
fds
Okay, I see it's not about mobile after all, simply based on window size.
Jack Douglas
ah yes, I remember now
fds
I don't keep my browser windows terribly wide.
Jack Douglas
I've fixed the link in the hamburger now too :)
Jack Douglas
sorry you had to go to all that trouble to report the issue!
fds
It's all right-- only shame it probably would have benefitted you more if I spent that time over here rather than there. Thank you again! The speed at which you fix things is scary.
Jack Douglas
heh, not everything, but thanks for the encouragement on that too
Jack Douglas
I'm very pleased we have Firebird on db<>fiddle, it is a nice little database
fds
Got to be honest I only play with Firebird for fun & fascination myself, but I also keep it running on my home server. I was amusing myself with this https://dbfiddle.uk/?rdbms=firebird_3.0&fiddle=db210d5f9d5d852b5daece8c789118c4 when I noticed the bug.
fds
A fun silly recursive CTE example from the SQLite docs that as an experience I adjusted to work in any dbms I could find. :)
fds
Still got to try and make it work in Db2 thank to dbfiddle, never had that installed myself.
Jack Douglas replying to fds
that's brilliant
Jack Douglas
on a par with this:
Jack Douglas
https://dbfiddle.uk/?rdbms=postgres_11&fiddle=71940aadda50f55bfede87606cd1dc2c
fds
Haha, here are the other versions that are 100%: https://dbfiddle.uk/?rdbms=mariadb_10.4&fiddle=20a848602194b3bce6a8617ba0df52dc
https://dbfiddle.uk/?rdbms=postgres_12&fiddle=c069a2fc0a9f3c09a53984b90cfe2155
https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=281d1897157594cf04ef0aef9df26357
https://dbfiddle.uk/?rdbms=sqlite_3.27&fiddle=0d6194c1b676c7d59a20eebb9e748124
https://dbfiddle.uk/?rdbms=oracle_18&fiddle=a309f1e1712317496a9dadb3602ee71f
fds
But again, I take no credit, it's simply from the SQLite manual, https://sqlite.org/lang_with.html
fds
All I'm doing is entertaining myself by porting it over to everything else.
Jack Douglas replying to fds
https://dbfiddle.uk/?rdbms=postgres_12&fiddle=29d878905d0df2b229c20340e6c110c2
Jack Douglas
in case you haven't done postgres yet :)
Jack Douglas
have you got a link to the sqlite version, I'd like to tweet it…
fds
Nah, the PG version was one of the first and most amenable. :) I posted all the links, including the SQLite one above, that's verbatim from the manual
fds
I'm yet to tackle Db2, and I'm fighting some kind of string truncation issue with MySQL 8, at least on dbfiddle.
fds
Note in PG you don't need that ugly double SELECT because it allows you to ORDER BY on string_agg(). That hack was solely for the Firebird version.
Jack Douglas
ah, didn't notice that message scrolled!
fds
Yeah, I'm probably doing something wrong, and not properly marking what I'm typing as being "replies to you," but unsure how to do that.
fds replying to Jack Douglas
let's see
fds
got it :)
fds
Figured out what was wrong with the MySQL 8 version, happy to say it wasn't a dbfiddle issue. There's simply a default 1K limit on group_concat(), but you can override. https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=14c70d261104bbae1c244cec2591a321
fds
Finally, Db2: https://dbfiddle.uk/?rdbms=db2_11.1&fiddle=4431fa7949ccffec75d88787f8dc1ec8 This was fun :)
Andriy M replying to Jack Douglas
Hey Jack, very nice, it [does appear](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=550e5882de11565e90a1b6b1be4fdc78) to be working correctly now. However, when I tried to re-run [the same test script](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=f9dbc388e0d0fdf4cf2ade4f806d7611), it failed for me. As far as I've managed to establish, it's `datetimeoffset` that breaks it. That is to say, any script with a `datetimeoffset` in it seems to fail now, so I can't give you a link for testing, but you can just try running `SELECT SYSDATETIMEOFFSET();` in any version of SQL Server to see for yourself.
Jack Douglas replying to Andriy M
ooh yes that's not good — I think I worked it out now though thanks again for helping me with all this (also @PeterVandivier)
Andriy M replying to Jack Douglas
Confirmed, things are back to normal in this department, great job!
Jack Douglas
:)
PeterVandivier
🎉
Andriy M
I wish could suggest something on the presentation part, I mean in particular reflecting the `n` of `datetime2(n)` correctly in the output
Andriy M
However, I did notice something peculiar. You can also specify an arbitrary precision for the `time` type as well. And I've noticed that `time(0)` at least shows without the fractional part, while `datetime2(0)` still shows the `.0000000`, [demo](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=4c9bccadd0672068960d9a1c7dd917c8)
Andriy M
All of `time(1)` through `time(7)` show 7 digits in the fractional part, though
Jack Douglas replying to Andriy M
I looked into this a bit, but couldn't work out how to get the precision info in .net
Jack Douglas
there were hints it might be possible, but it may well be beyond me
Jack Douglas
as soon as we have a vb.net community here I'll post a question :)
Andriy M replying to Jack Douglas
Oh, will it be a dedicated community for VB.NET? Are you intending to keep those people apart from everyone else?
Andriy M replying to Jack Douglas
What about the time zone info for `datetimeoffset`? Dbfiddle currently [doesn't seem to show the time zone](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=397dd18db05a66fba2ab965ea73cb100). Is that a problem too at the moment?
Jack Douglas replying to Andriy M
that shouldn't be a problem — it just needs to be added to the format string
Jack Douglas
I will add that at some point
Jack Douglas replying to Andriy M
I'd like to split the SO scope into smaller communities here if we can get people interested
Andriy M replying to Jack Douglas
Cool
Andriy M replying to Jack Douglas
Makes total sense to me, though at the same time, it may not be always obvious where to draw the boundaries
Andriy M
I guess it's a discussion worth its own meta question
Andriy M
Or a few
Jack Douglas
all very true!
Jack Douglas replying to Andriy M
what programming languages do you use, presumably not still delphi?
Andriy M replying to Jack Douglas
Actually I do still work with Delphi and almost nothing else, I mean as a major part of my work and not counting SQL Server. I've had to deal with an ASP script or two a few times, and also do some Windows batch scripting to solve some tasks and as a helping tool but that's just my choice. I know PoSh would be much superior most times, but it requires learning and I've been increasingly lazy learning new stuff lately
Andriy M
I know some other things as well, a little, as I've never used them professionally and haven't created anything major using them to claim I *actually* know them
Jack Douglas replying to Andriy M
if we had a Delphi community here would you be interested? I'm asking as an academic question — we'd probably see if things like C# would fly first, but I'd be interested to know nonetheless.
Andriy M replying to Jack Douglas
Not sure. When I first joined Stack Overflow, I thought Delphi would be speciality but I quickly found how much less I know about it than some other people. Our company used a rather outdated (pre .NET) version at the time, even though at least Delphi XE2 was already around then. We *have* switched to XE8 since then, but I'm still not very versed in the newer features, so I wouldn't be able to provide much help.
Jack Douglas replying to Andriy M
interesting, thanks :)
PeterVandivier
@Jack is it worth trying to close / lock the [meta.dba.se post](https://dba.meta.stackexchange.com/questions/2686/a-new-fiddle-for-dba-se) ?
PeterVandivier
give it a "historical significance" banner and stop new answers?
PeterVandivier
@Jack i know you're suuuuper busy with TA atm, but just to bump the issue :), [this seems like a freebie plug for cockroachdb on db<>fiddle](https://stackoverflow.com/q/59764636/4709762)
Jack Douglas replying to PeterVandivier
heh that does show it would be useful :)
Jack Douglas
we are moving DC over the next few weeks/months so if it does happen it'll be after that
Jack Douglas
probably worth moving any active feature requests you have here though?
Jack Douglas replying to PeterVandivier
I don't know if it's even necessary — the real problem is that the link in the hamburger was still pointing at the dba.se post!
Jack Douglas
fds — [a day ago](https://topanswers.xyz/transcript?room=37&id=13633#c13633)  
>Not on mobile, Mac laptop Apple Safari, but it very well might be mistaking that for mobile. Now I'm wondering what the "real" site is supposed to look like. Everything still functioned fine. I see like a play button / hamburger menu, click on it, and up pops a menu containing "comments/suggestions/bugs." That's what lead me to dba.se.
PeterVandivier replying to Jack Douglas
~~whaaaaaaat?! 😱 we're not gonna be neighbors anymore?? 😢~~  
  
misread as "_moving_ **to** _DC_", plz disregard
Jack Douglas
moving to DC might be nice, idk :) 
PeterVandivier
:-P
fds
MySQL 5.7 appears to be out of disk space at the moment: https://dbfiddle.uk/?rdbms=mysql_5.7&fiddle=480cf6b4bd63a8d4b2aff6a4f0e0efd5 (Errcode: 28 - No space left on device)
Jack Douglas replying to fds
thank you, that's all fixed now!