SQLiteFlow / SQLiteFlow-Issues

SQLiteFlow Support
10 stars 1 forks source link

Open SQLite file from command line? #252

Open johnhopson opened 2 weeks ago

johnhopson commented 2 weeks ago

Is there a way to open a SQLite file from the command line? e.g. open /Applications/SQLiteFlow.app "default.store"

SQLiteFlow commented 2 weeks ago

I believe it can already do this. What problem are you met when you tried to do this?

johnhopson commented 2 weeks ago

Ahh. You're right. I got the Terminal command line wrong. Below works. Thanks for following up.

open -a SQLiteFlow.app "/Users/<name>/Library/Containers/<appname>/Data/Library/Application Support/default.store"

SQLiteFlow commented 1 week ago

You're welcome and congrats! And I'm curious why are you trying to open SQLiteFlow from Terminal, is this part of some kind of automation steps?

johnhopson commented 1 week ago

Yes. I'm working on a SwiftData project and want visibility into the SQLite content for debugging. The project logs this line for easy access. Is there a better way to integrate with Xcode? (I'm new to SwiftUI/SwiftData)

SQLiteFlow commented 1 week ago

Is there a better way to integrate with Xcode?

That's depend on what you want to do eventually.

Assuming you're going to open a SQLite database on iOS simulator, I believe the Access Simulator feature will help, with this feature you don't have to log a line to know the database path.

Access Simulator can let you open your App's Documents folder in Finder directly, then you can open your SQLite database by double clicking it, once it opened, I believe you don't have to open it again and again.

Screenshots attached.

1 2
johnhopson commented 1 week ago

Thanks for the heads up. This project is actually a macOS project. But that access tool will be helpful when I get to iOS development.

SQLiteFlow commented 1 week ago

Oh I see. If a project is a macOS project, then its document folder is fixed, so why not add the document folder to Finder's sidebar (this can be achieved in Finder by dragging the document folder and dropping it to the sidebar), after that, you can navigate to your database whenever you want conveniently. But this is a personal preference though.