
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
@brevity-builder/postgres
Advanced tools
import postgres from "@brevity-builder/postgres/http";
const sql = postgres(connectionString);
async function getUsersOver(age) {
const users = await sql`
select
name,
age
from users
where age > ${age}
`;
// users = Result [{ name: "Walter", age: 80 }, { name: 'Murray', age: 68 }, ...]
return users;
}
async function insertUser({ name, age }) {
const users = await sql`
insert into users
(name, age)
values
(${name}, ${age})
returning name, age
`;
// users = Result [{ name: "Murray", age: 68 }]
return users;
}
async function transaction() {
const showLatestN = 10;
// Note: that neon's sql-over-http does not support interactive transactions
// so we are passing an arary to begin (and not a callback).
const [posts, tags] = await sql.begin([
sql`SELECT * FROM posts ORDER BY posted_at DESC LIMIT ${showLatestN}`,
sql`SELECT * FROM tags`,
]);
}
import postgres from "@brevity-builder/postgres";
const sql = postgres(connectionString);
async function getUsersOver(age) {
const users = await sql`
select
name,
age
from users
where age > ${age}
`;
// users = Result [{ name: "Walter", age: 80 }, { name: 'Murray', age: 68 }, ...]
return users;
}
async function insertUser({ name, age }) {
const users = await sql`
insert into users
(name, age)
values
(${name}, ${age})
returning name, age
`;
// users = Result [{ name: "Murray", age: 68 }]
return users;
}
async function transaction() {
const [user, account] = await sql.begin(async (sql) => {
const [user] = await sql`
insert into users (
name
) values (
'Murray'
)
returning *
`;
const [account] = await sql`
insert into accounts (
user_id
) values (
${user.user_id}
)
returning *
`;
return [user, account];
});
}
Please see the Postgres.js docs for more information about the api.
MIT
FAQs
Unknown package
We found that @brevity-builder/postgres demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.