What is Hackers' Pub?
Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.

![Source code for running an embedded Rust program creating a Sqlite Database connection via Diesel and executing several queries.
```rust
#[unsafe(no_mangle)]
extern "C" fn sqlite3_os_init() -> core::ffi::c_int {
println!("Setup os");
unsafe {
crate::memory::install();
}
libsqlite3_sys::SQLITE_OK
}
#[esp_hal::main]
fn main() -> ! {
let config = esp_hal::Config::default().with_cpu_clock(esp_hal::clock::CpuClock::max());
let peripherals = esp_hal::init(config);
println!("Firmware starting");
esp_alloc::heap_allocator!(size: 100 * 1024);
println!("Before sqlite");
let mut conn = SqliteConnection::establish(":memory:").unwrap();
conn.set_instrumentation(|event: diesel::connection::InstrumentationEvent<'_>| {
println!("Execute query: {event:?}")
});
conn.batch_execute("CREATE TABLE users(id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL)")
.unwrap();
diesel::insert_into(users::table)
.values([users::name.eq("John"), users::name.eq("Jane")])
.execute(&mut conn)
.unwrap();
let delay = Delay::new();
loop {
let data = users::table
.filter(users::name.eq("Jane"))
.first::<(i32, String)>(&mut conn)
.unwrap();
println!("----");
println!("Query data:");
println!("Loaded user data: {} -> {}", data.0, data.1);
println!("---");
delay.delay_millis(500);
}
}
```](https://social.weiznich.de/system/media_attachments/files/115/674/254/327/314/311/original/821f1497450d7ba0.png)









DevelopersIO 
















