Junior — Middle
What experience do you have with pure SQL outside of ORM usage?
sobes.tech AI
Answer from AI
Working with raw SQL outside of ORM, I wrote queries for complex selections, optimized performance through indexes and execution plan explanations (EXPLAIN), and also implemented transactions and stored procedures. For example, in Node.js using the pg module for PostgreSQL, I wrote queries directly:
const { Client } = require('pg');
const client = new Client();
async function getUsers() {
await client.connect();
const res = await client.query('SELECT id, name FROM users WHERE active = $1', [true]);
await client.end();
return res.rows;
}
This allowed flexible query management, bypassing ORM limitations and optimizing database interactions.