code-center/src/scripts/sp-snippet.ts
2024-11-28 21:08:27 +08:00

22 lines
468 B
TypeScript

import { Snippet } from '@/routes/snippet/snippet.ts';
const main = async () => {
const snippet = await Snippet.findAndCountAll();
console.log(snippet.count);
};
// main();
const addOne = async () => {
const snippet = await Snippet.create({
title: 'Hello',
description: 'Hello World',
snippet: 'console.log("Hello")',
keyword: '!hello',
user_id: '3f82e3ae-b7c2-4244-849f-d453f304b2f2',
});
console.log(snippet);
};
// await addOne();