
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@tragedy-labs/sprite
Advanced tools
Sprite is a TypeScript driver for ArcadeDB.
Read the documentation, or see the examples below.
(Use whichever package manager you prefer)
<npm|pnpm|yarn|bun> <install|add> @tragedy-labs/sprite
@import { SpriteServer } from '@tragedy-labs/sprite';
const server = new SpriteServer({
username: 'aUser',
password: 'aPassword',
address: 'http://localhost:2480'
});
async function example() {
const ready = await server.serverReady();
console.log(ready);
// true;
try {
const db = await server.createDatabase('aDatabase');
console.log(db.name);
// 'aDatabase'
const result = await db.command(
'sql',
'CREATE document TYPE aType'
);
console.log(result);
// [
// {
// operation: 'create document type',
// typeName: 'aType'
// }
// ]
// CRUD must be transactional
// Parameterized commands are used to prevent
// SQL injection, parameters are passed in an
// object as the third argument
db.transaction(async (trx) => {
const doc = trx.crud(
'sql',
'INSERT INTO aType SET aProperty = :aValue',
{ aValue: 1 }
);
});
} catch (error) {
throw new Error('Could not create database', { cause: error });
}
}
example();
@import { SpriteDatabase } from '@tragedy-labs/sprite';
@import type {
CreateDocumentType,
InsertDocument,
SelectFrom
} from '@tragedy-labs/sprite';
const db = new SpriteDatabase({
username: 'aUser',
password: 'aPassword',
address: 'http://localhost:2480',
databaseName: 'aDatabase'
});
type ExampleDoc = {
aValue: string;
};
async function example() {
try {
const created = await db.command<CreateDocumentType>(
'sql',
'CREATE document TYPE aType'
);
console.log(created);
// [
// {
// operation: 'create document type',
// type: 'aType'
// }
// ]
const schema = await db.getSchema();
console.log(schema);
// [...]
// CRUD must be part of a transaction
// Parameterized commands are used to prevent
// SQL injection, parameters are passed in an
// object as the third argument.
db.transaction(async (trx) => {
await trx.crud(
'sql',
'INSERT INTO aType SET aProperty = :aValue',
{ aValue: 1 }
);
});
const docs = await db.query<SelectFrom<ExampleDoc>>(
'sql',
'SELECT * FROM aType'
);
console.log(docs);
// [
// {
// aProperty: 'aValue'
// }
// ]
} catch (error) {
throw new Error('An error occured...', { cause: error });
}
}
example();
FAQs
A TypeScript driver for ArcadeDB
The npm package @tragedy-labs/sprite receives a total of 2 weekly downloads. As such, @tragedy-labs/sprite popularity was classified as not popular.
We found that @tragedy-labs/sprite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.