Giter Club home page Giter Club logo

Comments (6)

stephencelis avatar stephencelis commented on May 18, 2024 1

I should probably have better explicit examples in the README, but the path needs to be a place your app can reach, e.g.:

let path = NSSearchPathForDirectoriesInDomains(
    .DocumentDirectory, .UserDomainMask, true
).first as String

let db = Database("\(path)/db.sqlite3")

If you want to nest the database in a directory, you'll need to create one first.

from sqlite.swift.

stephencelis avatar stephencelis commented on May 18, 2024

No "thanks in advance" necessary till you give me enough information to troubleshoot :) Please describe your exact setup and how/where your Database file is getting stored. Thanks!

from sqlite.swift.

stephencelis avatar stephencelis commented on May 18, 2024

(If you are actually pasting that line in, you need to replace "path/to/db.sqlite3" to a resolvable path in your application.)

from sqlite.swift.

LazyTravis avatar LazyTravis commented on May 18, 2024

My Setup is : New project -> single view application - > input product name,do not choose Use Core data(even choose it,still same error)->then choose a place to create.

After that,I do as your screen dumped.

I can run below code.Very strange.My new application is not in the same path of SQLite
let db = Database("")
let db = Database()

I try to write let db = Database("db.sqlite3"),but it still can't work.

from sqlite.swift.

LazyTravis avatar LazyTravis commented on May 18, 2024

It's the first time to use SQLite,so I have no idea whether need to configure something else.:)

from sqlite.swift.

LazyTravis avatar LazyTravis commented on May 18, 2024

Cool,It can works now.

from sqlite.swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.