Noob Question: SQL INSERT that combines static values with a SELECT statement

AAlfieGoat5/8/2023
Hey Kysely community! I'm just getting into Kysely and I have a question about how I could run the following query with Kysely:

INSERT INTO employees (employee_id, first_name, last_name, department_id)
VALUES (1234, 'John', 'Doe', 
        (SELECT department_id 
         FROM departments 
         WHERE department_name = 'Sales')
);


I could get an INSERT + SELECT query to work, but wasn't sure how to add static values into the mix.

Thanks in advance : )
KNKristian Notari5/8/2023
kysely.insertInto('employees').values({
employee_id: 1234, 
first_name: 'John', 
last_name: 'Doe', 
department_id: eb => eb.selectFrom('departments').select('department_id').where(...)
})

does this work?
KNKristian Notari5/8/2023
can't test it right now
AAlfieGoat5/8/2023
That's exactly it, thank you!!