O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SQLite

There are a couple of options for connecting to SQLite. We'll go with John Gallagher's Rusqlite, which is available at https://github.com/jgallagher/rusqlite. Its API could be called mid-level: it helpfully hides many of the details of the actual SQLite API but is not laden with high-level abstractions such as struct mappings.

In contrast to many other relational database systems, SQLite's type system is dynamic. This means that columns do not have types but each individual value does. Technically, SQLite separates storage classes from data types, but this is mainly an implementation detail, and we may just think in terms of types without being too far from the truth.

Rusqlite provides FromSql and ToSql traits for converting objects ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required