Search code examples
swiftswift-playgroundgrdb

Running GRDB in a playground


Being new to this programming environment, this instruction that appears at the top of the playgrounds shipped with GRDB leaves me not knowing how to proceed:

To run this playground, select and build the GRDBOSX scheme.

Steps taken so far include going to the github page> clone or download > download zip > unpack.

I was able to run the sample projects on the simulator, but so far, not able to run the sample playgrounds. I get:

error: no such module 'GRDB'
import GRDB
       ^

The documentation for manual installation appears to cover adding GRDB to your project, as opposed to adding it to a playground.

Since the sample projects already work, I thought there would be an easy way to get the playgrounds working, but before I start trying things, and possibly doing it wrong, I thought I'd ask here for the right way to proceed.


Solution

  • GRDB author here. To run those playgrounds:

    • Open the GRDB.xcworkspace workspace
    • Select the GRDBOSX scheme in the menu next to the Run/Stop buttons on the top left of the window
    • Select the Build command in the Product menu (Command-B)
    • Select a playground in the source list on the left of the window (they are in the "Playground" folder at the top)
    • Hit Run, and enjoy :-)