mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Playgrounds/MyPlayground.swift
This commit is contained in:
1 parent
dda8df678a
commit
141dc247d6
3 files changed
+22
No files matched your search
+3
@@ -22,6 +22,9 @@
|
||||
<FileRef
|
||||
location = "group:UserDefaults.playground">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:MyPlayground.playground">
|
||||
</FileRef>
|
||||
</Group>
|
||||
<FileRef
|
||||
location = "group:GRDB.xcodeproj">
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// To run this playground, select and build the GRDBOSX scheme.
|
||||
|
||||
import GRDB
|
||||
|
||||
let path = "/tmp/database.sqlite"
|
||||
var configuration = Configuration()
|
||||
configuration.trace = { print($0) }
|
||||
let dbQueue = try! DatabaseQueue(path: path, configuration: configuration)
|
||||
|
||||
try! dbQueue.inDatabase { db in
|
||||
try db.create(table: "persons", ifNotExists: true) { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("name", .text)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<playground version='5.0' target-platform='macos'>
|
||||
<timeline fileName='timeline.xctimeline'/>
|
||||
</playground>
|
||||
Reference in new issue
Block a user