Because the SQLite database was used in the iOS project, looking for a supported library on GitHub, the library was found
Https://github.com/stephencelis/SQLite.swift
Follow the instructions in the documentation to download the project and attach it to your project
And then import this module into your own project.
Import SQLite
The simple syntax, the first to initialize the library, for example, I use an external library, follow the path to open
let db=Database(path,readonly:true)
and set it to read-only
Initializing tables
let brand=db["brand"]
let car_brand=db["Car_brand"]
let color=db["Color"]
let vehicle_type=db["Vehicle_type"]
Then initialize the field, where only the fields in the brand table are initialized
let brand_id = expression < "id"
let Brand_abb = expression < string > (
let brand_name = Expression<String> (" Car_name ")
It can then be quid operation, the type of the field must be correct, otherwise it will be an error
See official documentation for details
Https://github.com/stephencelis/SQLite.swift/blob/master/Documentation/Index.md
From for notes (Wiz)
Operating the database with the Sqlite.swift Open Source Library