https://github.com/lldap/lldap logo
Join Discord
Powered by
# general
  • j

    jensen

    04/25/2025, 11:46 AM
    If you just have it stopped, while you activate WAL, it seems it should work going forward? At least that's how I interpret the docs 🙂
  • d

    darabi

    04/25/2025, 11:47 AM
    It's easy to try out (just a
    docker compose up
    away) ...
  • n

    nitnelave

    04/25/2025, 11:51 AM
    Sure, it doesn't have to be very long, just a couple of paragraphs with links and a sample docker compose
  • d

    darabi

    04/25/2025, 11:55 AM
    The setting survives server restarts:
    Copy code
    sqlite3 data/users.db "pragma journal_mode"
    # -> wal
    docker compose up -d
    [+] Running 2/2
     ✔ Network lldap_default    Created               0.2s
     ✔ Container lldap-lldap-1  Started               0.5s
    
    sqlite3 data/users.db "pragma journal_mode"
    wal
  • d

    darabi

    04/25/2025, 11:58 AM
    @nitnelave: would you mind adding a
    pragma journal_mode=WAL
    to the initialisation of the newly created DB?
  • d

    darabi

    04/25/2025, 11:59 AM
    I don't see any real drawbacks other than the 1-2% performance hit, which I'd say is negligible. The other disadvantages mentioned in https://www.sqlite.org/wal.html are irrelevant for the use case.
  • j

    jensen

    04/25/2025, 12:01 PM
    You don't technically need it, you just need to stop lldap once, and set it manually, then you're set. I could imagine nitnelave would prefer not to have that sqlite specific initialization in lldap, when it's not needed -- can't say for sure though 🙂
  • d

    darabi

    04/25/2025, 12:02 PM
    Ah the schema migration is DB agnostic? Then forget what I said.
  • j

    jensen

    04/25/2025, 12:04 PM
    Yeah, I think all of it is.
  • d

    darabi

    04/25/2025, 12:05 PM
    Never had the chance to look into Rust. Is it an ORM tool which creates the schema?
  • d

    darabi

    04/25/2025, 12:11 PM
    Found it: SeaORM https://github.com/lldap/lldap/blob/main/crates/domain-model/src/model/users.rs
  • n

    nitnelave

    04/25/2025, 12:12 PM
    We already have one SQLite specific pragma
  • n

    nitnelave

    04/25/2025, 12:12 PM
    I think we just execute the SQL and ignore errors (for the other engines)
  • n

    nitnelave

    04/25/2025, 12:12 PM
    I forget which one
  • d

    darabi

    04/25/2025, 12:13 PM
    ./crates/sql-backend-handler/src/sql_migrations.rs
  • d

    darabi

    04/25/2025, 12:14 PM
    https://github.com/lldap/lldap/blob/main/crates/sql-backend-handler/src/sql_migrations.rs#L141
  • n

    nitnelave

    04/25/2025, 12:15 PM
    That's the one
  • d

    darabi

    04/25/2025, 12:21 PM
    DatabaseConnection has a get_database_backend which returns an enum which contains
    Sqlite
    in case of sqlite: https://docs.rs/sea-orm/latest/sea_orm/type.DbBackend.html
  • n

    nitnelave

    04/25/2025, 12:22 PM
    I know, I added that :p
  • n

    nitnelave

    04/25/2025, 12:22 PM
    I guess I haven't migrated my code yet!
  • d

    darabi

    04/25/2025, 12:24 PM
    I'll be back next week to bug you with additional questions when starting to use lldap. Have a nice weekend!
  • g

    GeeCoffee

    04/27/2025, 11:29 AM
    is there a cli tool to create users with?
  • g

    GeeCoffee

    04/27/2025, 11:30 AM
    or a api?
  • n

    nitnelave

    04/27/2025, 12:05 PM
    There's both! You can create users through the LDAP protocol, although it's not fully supported. We have a GraphQL API (see docs/scripting.md), and there's a community written CLI using that API, lldap-cli
  • g

    GeeCoffee

    04/27/2025, 12:16 PM
    thanks I'll take a look
  • t

    TheRedCyclops

    04/27/2025, 2:15 PM
    can the secrets be specified with a docker secret?
  • t

    TheRedCyclops

    04/27/2025, 4:14 PM
    nvm, figured it out
  • t

    TheRedCyclops

    04/27/2025, 4:14 PM
    (they can)
  • n

    nitnelave

    05/02/2025, 4:47 AM
    Hello everyone! I'm making a crowd sourcing experiment to develop a tool for automated rust refactoring (extract a crate), have a look and participate! https://www.reddit.com/r/rust/s/ETulG9w9iO
  • j

    jensen

    05/02/2025, 7:21 AM
    hehe, sounds like a fun experiment 🙂