or
Jack Douglas
dbfiddle
[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
PeterVandivier
`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
PeterVandivier
`bug` `planned` Brittle fiddle one-boxing in chat

One-boxing in small fiddles in chat is great. Sadly, it seems that leaving a page and returning causes the one-boxing render to break. 

See [this chat thread][1] for context & repro steps.  

Note that the transcript one-boxing appears to be stable and does not appear to be affected by this behaviour. 

Using...

> Google Chrome Version 79.0.3945.130 (Official Build) (64-bit)

[1]: https://topanswers.xyz/transcript?room=644&id=16493#c16493
[2]: https://topanswers.xyz/transcript?room=37&id=16598#c16598
Answer #3
Ami
`bug` clicking 'Back' should switch back not only the query, but also the database selection.

---

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.
Answer #4
PeterVandivier
`feature-request` please add an (opt-in) cookie to remember the last platform a user was on?

# 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 #5
PeterVandivier
`bug` All-null rows collapsing in embedded fiddles

In the following fiddle, rows that contain only null values are collapsed in an unfriendly way 

<>https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=4f964e57bb433e06f0bdcc41992605af
Answer #6
PeterVandivier
`feature-request` please add CockroachDB

---

## 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 #7
PeterVandivier
`bug` 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 #8
PeterVandivier
`feature-request` `declined` add an 'Update this post' button on embedded db<>fiddles on TopAnswers

---

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?
Answer #9
Arioch
`bug` `fixed`: Firebird, datatypes, aligning

https://dbfiddle.uk/?rdbms=firebird_3.0&fiddle=c80635f28efd64914a70160a0cc46ecf

Check last query, and it is especially visible in MarkDown export.

Columns 3 to 5 are left-aligned, despite being numeric.

I suspect the type BigInt or what they are is mis-detected for textual one.
Answer #10
Arioch
`feature-request` [`declined`](https://topanswers.xyz/transcript?room=37&id=17302#c17302) Allow multiple statements per batch for Firebird again

---

Firebird, DDL, multiple statements

As far as I remember, this used to work, but no more.

Perhaps parser fails to split script into distinct SQL statements.

https://dbfiddle.uk/?rdbms=firebird_3.0&fiddle=300756710cf77de8d754f04bbcfa07de

```
create table KPS1 ( ID integer primary key, DATE_FROM date not null, DATE_TO date not null ); 
create table KPS2 ( ID integer primary key, DATE_FROM date not null, DATE_TO date not null )
```

Dynamic SQL Error SQL error code = -104 Token unknown - line 6, column 1 create
Answer #11
John aka hot2use
`feature-request` `retracted` Add support for SQL Server `GO [count]` syntax

---

# Support for SQL Server `GO [count]` syntax

In SQL Server you can add the batch operator [`GO`](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go?view=sql-server-ver15) to the end of either a single or a bunch of commands like this:

    SELECT 1
    GO
    
Or even like this:

    INSERT INTO [TableName] (SomeText, SomeInt)
    VALUES ('false', 1)
    GO
    
If I want to really insert a bunch of items into a table I can tell `GO` to do this multiple times like this:

    INSERT INTO [TableName] (SomeText, SomeInt)
    VALUES ('false', 1)
    GO 633
    
...and the query "batch" will be executed 633 times. 

This is helpful when inserting a fixed amount of pseudo data into a table to reproduce issues in a development environment (and would be helpful in db<>fiddle).

_Sadly I can't add a db<>fiddle to show you how it should work ;-)_

I think the `GO` utility statement has been discussed before, but I don't think the additional `count` was part of the discussion.


### Reference Material

[SQL Server Utilities Statements - GO](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go?view=sql-server-ver15) (Microsoft | SQL Docs)
How can we make db<>fiddle (and integration here) better?
PeterVandivier
lol, yea that'd be a very pleasing symmetry
Jack Douglas
I'd quite like to make the topanswers data dump a regularly updated sample db in postgres — that kind of kills the SEDE bird very simply
PeterVandivier
but idk how many people besides me do that frequently
PeterVandivier
the current experience being that you can click between platforms with the same hash
PeterVandivier replying to Jack Douglas
that's rather what i was thinking, yea
Jack Douglas
plus the idiomatic one for that platform
Jack Douglas
but perhaps there only needs to be one sample database that works across dbs
Jack Douglas replying to PeterVandivier
it has the one big advantage of being useful when comparing different rdbms's
PeterVandivier
but i suppose thats a bit silly
PeterVandivier replying to Jack Douglas
https://www.postgresqltutorial.com/postgresql-sample-database/
PeterVandivier
yea, i was thinking there'd be cross-platform support for each database rather than limiting AdventureWorks to just sql server for example
Jack Douglas replying to PeterVandivier
Is DVDRentals 'the' sample db for Postgres?
Jack Douglas
https://wiki.postgresql.org/wiki/Sample_Databases
Jack Douglas
https://www.sqlitetutorial.net/sqlite-sample-database/
Jack Douglas replying to PeterVandivier
how do you mean?
PeterVandivier
lol, might make sense to just use the popular ones where they'll be used, eh?
Jack Douglas
so "Sakila" for MySQL, "AdventureWorks" for SQL Server
PeterVandivier
and assuming that's something you were thinking you want (AdventureWorks on SQLite, DVDRentals on SQL Server, etc)
Jack Douglas replying to PeterVandivier
that's a very kind offer. I suspect each RDBMS will want it's own idiomatic sample DB though
PeterVandivier
anyway, i'd be happy to volunteer with porting the candidate databases between platforms assuming that's helpful
PeterVandivier
i wonder if there's a sensible way to parse out at some step which objects are used in the fiddle and drop all others so you don't burn through disk 
Jack Douglas
I'm doing a whole bunch of work on db<>fiddle right now and this is something I'm keen to add if possible
Jack Douglas replying to PeterVandivier
Yes, and it's been requested before (by @Ami)
PeterVandivier
i was thinking maybe a "featured fiddle" could be nice. idk if there's anything like a "popular" fiddle or something that gets a lot of hits, but it might be fun to tweet out interesting fiddles once a week or something
PeterVandivier
::: quote 4 32429 14 212,223,236 62,103,153
Josh Darnell *— 11 hours ago* *in [stop the merry-go-round](/databases?room=4#c32429)*  
>You know what would be cool?  If @Jack had popular sample databases up on db<>fiddle.
:::
PeterVandivier
friggin log files always up to no good
Jack Douglas replying to PeterVandivier
fixed, thanks — some log files had expanded to fill the hard drive
Jack Douglas
^^^ apart from that one I mentioned earlier
Jack Douglas
::: quote 37 17227 2 212,223,236 62,103,153
Jack Douglas replying to PeterVandivier[ *— a month ago*](#c17227)  
>you can hide some of the batches, though topanswers doesn't honour that yet — it should though and we'll no doubt get round to that because it'd be useful here
:::
Jack Douglas
there are a few similar issues
Jack Douglas replying to PeterVandivier
yes that's right
PeterVandivier
![blob](/image?hash=a92e0cb88e141c4f0acd2bfcd7d2331528d231bf61cb263d75a2f69efa27f8b3)
PeterVandivier
related: is something up with MySQL 8.0 on db<>fiddle atm? can't seem to run it @Jack 
PeterVandivier
just noticed that it's only integration here - web portal has the null placeholder :-P
PeterVandivier
or has it just not come up before?
PeterVandivier
re: null-row collapse. i assume you've also previously thought about adding the "_null_" text placeholder to differentiate empty-string cells from true `null` cells. was there a compelling reason to leave it out? lots of PITA config between drivers for the different engines or something?
Jack Douglas replying to Bob Zeller
thanks Bob, will bear in mind the UX tips :)
Bob Zeller
This is great! The functionality is all there unlike sqlfiddle that coughs violently. My only suggestion is to secure a graphic designer to make it look less pre-911. The graphics and layout have that UNIX macho aesthetic designed to intimidate the unseasoned and terrify the novice. Lot's of good work going on here.
PeterVandivier
Oh cool, I wasn’t even thinking proper tags, tbh. Just of using emoji in the preformatted text. I’m all for solving the general problem though rather than the local one 🙂
Jack Douglas
I'm not sure answer tags would be useful anywhere other than CG or possibly TeX, but they'd be available
Jack Douglas
at some point we'll move db<>fiddle issues entirely to GitHub I think so it won't be an issue here
Jack Douglas replying to PeterVandivier
we are still thinking about answer tags — not really specifically for this post or dba.ta at all, but for Code Golf
PeterVandivier
https://github.com/vexx32/PSKoans by way of constructive real-world example
PeterVandivier
by way of further reading
PeterVandivier
https://gitmoji.carloscuesta.me/
PeterVandivier
wondering if a visual "helper" indicator is prudent
PeterVandivier
just thinking that as the number of answers grows ever _huger_, the tags in aggregate are sort of making my eyes glaze over when i expand the whole list
PeterVandivier
e.g. - instead of `bug`, you have `🐛bug`, instead of `declined`, you have `🚫declined`
PeterVandivier
i feel like it might be too cluttered, but just because the thought crossed my mind... how do you feel about using "gitmoji" style tags for this post?
Jack Douglas
this is one of the few places you'd notice because generally we don't post multiple answers to the same question…
Jack Douglas replying to PeterVandivier
I think that might be a hangover from the earlier bug — it caches answers to each question individually so if you answered here while the bug was active, then try and answer after it's fixed, you'll get the old text. Only once though.
PeterVandivier
i'll leave it for a few mins if you want me to check anything on my end
PeterVandivier
looks like the cached previous post may be back. just went in to post a new answer and i'm seeing the "brittle fiddle one-boxing" rev 1 looks like
Jack Douglas replying to Arioch
I agree on all counts — however db<>fiddle has a golden rule: we do not parse SQL that is being processed. It's a rule that has served us well so far, it saves us from all sorts of complexity down that route.
Arioch replying to Jack Douglas
@JackDouglas - split batch is not a problem, copy-paste is not hard to do. The problem is visual clutter and noise. Non-grouped statements are harder to read. It is pity DB-Fiddle can not split the script into statements and feed them to server one by one...
Jack Douglas
@Arioch do you know about the 'split batch' button?   
![Screenshot 2020-02-04 at 08.49.49.png](/image?hash=244b61bb24957a970d9e7d8d73ab3e4af579ea29d9a37b1408e18de089ec60e2)  
 I don't think the PHP Firebird/Interbase driver supports multiple statements per batch like some others do so we can't enable this in db<>fiddle.
Jack Douglas replying to PeterVandivier
you can hide some of the batches, though topanswers doesn't honour that yet — it should though and we'll no doubt get round to that because it'd be useful here
PeterVandivier
@Jack should there be a community etiquette around max size of embedded fiddles? i was going to edit those firebird answers to be one-boxed but the (first one at least) was large enough that i paused. 
PeterVandivier replying to Jack Douglas
cool beans & no worries! glad to have it referenced explicitly though. fwiw - i think it'd be totally acceptable to throttle fiddle one-boxing in chat to one or 2 batches or something sensible like that. tbh, i was actually a bit surprised/impressed that fiddle one-boxing in chat is supported at all so hear it needs to be throttled a bit makes a lot of sense
Jack Douglas
@PeterVandivier that's actually deliberate because when there are several it can slow down rendering unacceptably. We have a plan to fix it though by caching db<>fiddle results on the client. Will update your post when that lands!
John aka hot2use replying to Jack Douglas
I certainly will
Jack Douglas replying to John aka hot2use
thanks @John but do keep them coming :)
John aka hot2use
I have retracted the feature request, edited it and left it here for historical reasons.
Andriy M
`GO number` itself already raises questions, for instance how to handle multiple result sets, especially if someone accidentally runs it with a big number
Andriy M
I'm only slightly worried by the fact that it would created a precedent for others to request all sorts of client side features to be implemented for other DBs as well, and some of them might be either too difficult or too rubbish but Jack would be too nice to refuse and try to implement them anyway, and dbfiddle might end up unnecessarily complicated, in terms of both maintenance and usage
PeterVandivier
esp. b/c it seems like the kind of thing that _seems_ simple enough, but might actually require some non-trivial work on the backend to support it
PeterVandivier
if & when db<>fiddle is open-sourced a la TA, it'd be a fun "up for grabs" type issue, but i don't think it'd important enough to divert Jack or James from other work atm
PeterVandivier
i've been bit by it and it would be nice, but imo it's not the biggest deal
John aka hot2use
Opinions? Anybody?
John aka hot2use replying to Andriy M
Seeing as `GO` seems to be a client-side "operation" as per Andriy's feedback, I could retract my suggestion altogether. 
John aka hot2use replying to Jack Douglas
I'm not sure about the "generic" bit, but a mechanism to execute something x number of times would be cool.
Andriy M replying to PeterVandivier
Ah yes, we've already had that discussion
Jack Douglas replying to Andriy M
I don't think it does
PeterVandivier replying to Andriy M
[deja vu 😜](https://chat.stackexchange.com/transcript/message/51423950)
Andriy M
It's like the MySQL `DELIMITER` instruction. Does dbfiddle support MySQL's `DELIMITER`?
Andriy M
@John @Jack `GO` is a client-side feature. In addition to having to figure out how to handle multiple outputs it can produce, implementing it may also pose a question whether (or which) other client-side features should be implemented as well (including those of other platforms). Or does dbfiddle have any implemented already?
Jack Douglas
I guess we could compare the output and if they are all the same then print just once (or should the 'repeat' count)
Jack Douglas
@John are you really asking if we can have some generic mechanism for executing batches multiple times? That sounds like something that might be possible. What would we do with the output from the batches though — presumably not just display it all (like this: https://dbfiddle.uk/?rdbms=postgres_12&fiddle=f5e1af43aff680d5036121284716c999)
Andriy M
Based on my past experience, I'm guessing Chrome would do this on any page that has an input form. And Dbfiddle.uk of course would be a typical example, which is why the issue has been raised. It used to work like that for me in Firefox, but apparently they've since changed/fixed it
GeorgePalacios replying to Andriy M
I get it in Chrome
Andriy M replying to GeorgePalacios
In Firefox?
GeorgePalacios replying to Andriy M
That still happens to me all the time lol!
Andriy M
@Ami This reminds me of a similar issue I used to have when searching with Google. Basically, I would first enter one request, say 'foo', click 'Search', get the results, then enter 'bar' into the search box, 'Enter', get new results, then click 'Back', and I would get the previous search results, for 'foo', but the search box would show 'bar'. The last time I experienced that was quite some time ago, and I never found out for sure if it was an issue with the site or my browser, but I believed it to be with the browser (or browser + OS maybe). For the record, I don't experience the issue you've described in my Firefox on Win 7.
Jack Douglas replying to fds
thank you, that's all fixed now!
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)
PeterVandivier
:-P
Jack Douglas
moving to DC might be nice, idk :) 
PeterVandivier replying to Jack Douglas
~~whaaaaaaat?! 😱 we're not gonna be neighbors anymore?? 😢~~  
  
misread as "_moving_ **to** _DC_", plz disregard
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.
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
probably worth moving any active feature requests you have here though?
Jack Douglas
we are moving DC over the next few weeks/months so if it does happen it'll be after that
Jack Douglas replying to PeterVandivier
heh that does show it would be useful :)
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)
PeterVandivier
give it a "historical significance" banner and stop new answers?
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) ?
Jack Douglas replying to Andriy M
interesting, thanks :)
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
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
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