Skip to content

Commit efda996

Browse files
committed
Move SQLFiddle to a SQLite backend since we are going to host on Linux.
1 parent 8713e66 commit efda996

6 files changed

Lines changed: 12 additions & 7 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## SQLFiddle output
2+
/demos/SQLFiddle/SQLFiddle.Website/sqlfiddle.db
3+
14
## Ignore Visual Studio temporary files, build results, and
25
## files generated by popular Visual Studio add-ons.
36

@@ -254,3 +257,4 @@ paket-files/
254257
# Compiled python bytecode
255258
*.pyc
256259
/src/Rezoom.SQL.Provider/Properties/launchSettings.json
260+

demos/SQLFiddle/SQLFiddle.Website/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
},
88
"AllowedHosts": "*",
99
"ConnectionStrings": {
10-
"SQLFiddle": "Data Source=.\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=SQLFiddle;TrustServerCertificate=true"
10+
"SQLFiddle": "Data Source=sqlfiddle.db"
1111
}
1212
}

demos/SQLFiddle/SQLFiddle/Persistence.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ let private sha1 (fiddleData : FiddleInput) =
3131
hasher.Hash
3232

3333
type SaveFiddleSQL = SQL<"""
34-
insert into Fiddles(SHA1, Backend, Model, Command)
35-
select @sha1, @backend, @model, @command
34+
insert into Fiddles(SHA1, CreatedUtc, Backend, Model, Command)
35+
select @sha1, @createdUtc, @backend, @model, @command
3636
where not exists(select null x from Fiddles where SHA1 = @sha1)
3737
""">
3838

@@ -44,6 +44,7 @@ let saveFiddle fiddleData =
4444
SaveFiddleSQL.Command
4545
( fiddleData.Backend.ToString()
4646
, fiddleData.Command
47+
, DateTime.UtcNow
4748
, fiddleData.Model
4849
, sha1
4950
)

demos/SQLFiddle/SQLFiddle/SQLFiddle.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<PackageReference Include="FSharp.Core" Version="8.0.401" />
2525
<PackageReference Include="Rezoom" Version="1.4.0" />
2626
<!-- Wrapper meta-package: brings in Rezoom.SQL.Provider, Compiler, Mapping, and
27-
Microsoft.Data.SqlClient as the TSQL runtime driver. -->
28-
<PackageReference Include="Rezoom.SQL.Provider.TSQL" Version="0.13.0" />
27+
Microsoft.Data.Sqlite as the SQLite runtime driver. -->
28+
<PackageReference Include="Rezoom.SQL.Provider.SQLite" Version="0.13.0" />
2929
</ItemGroup>
3030

3131
</Project>

demos/SQLFiddle/SQLFiddle/V1.model.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
create table Fiddles
22
( SHA1 binary(20) primary key
3-
, CreatedUtc datetime default(sysutcdatetime())
3+
, CreatedUtc datetime
44
, Backend string(8)
55
, Model string
66
, Command string
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"backend": "tsql",
2+
"backend": "sqlite",
33
"connectionName": "SQLFiddle"
44
}

0 commit comments

Comments
 (0)