Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
[!WARNING]
Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
[!WARNING]
| export interface Props { | |
| date: number; | |
| } | |
| const { date } = Astro.props; | |
| const dateFormat = (datetime: number) => { | |
| const dateTime = new Date(datetime * 1000); | |
| const date = dateTime.toLocaleDateString([], { |
| import { createClient } from "@libsql/client/web"; | |
| export const client = createClient({ | |
| url: import.meta.env.TURSO_DB_URL, | |
| authToken: import.meta.env.TURSO_DB_AUTH_TOKEN | |
| }); |
| -- create an authors table | |
| create table authors( | |
| id integer primary key, | |
| first_name varchar(20) not null, | |
| last_name varchar(20) not null, | |
| slug varchar(50) not null, | |
| email text not null, | |
| avatar text, | |
| twitter text, | |
| website text, |
| import rss from '@astrojs/rss'; | |
| import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; | |
| import { client } from '../lib/tursoDb'; | |
| import type { APIContext } from 'astro'; | |
| let posts: any[] = []; | |
| try { | |
| const allPostsResponse = await client.execute({ | |
| sql: "select posts.title, posts.description, posts.slug, posts.hero, authors.first_name, authors.last_name, authors.slug as author_slug, authors.avatar, posts.content, posts.created_at from posts left join authors on authors.id = posts.author_id order by posts.created_at desc;", | |
| args: [], |
| --- | |
| import { Markdown } from "@astropub/md" | |
| import BlogPost from '../../layouts/BlogPost.astro'; | |
| import { client } from '../../lib/tursoDb'; | |
| import type { Blog } from '../../lib/types'; | |
| const { slug } = Astro.params; | |
| let post: Blog | null = null; | |
| if(!slug){ |
| export interface Author { | |
| id?: number; | |
| first_name: string; | |
| last_name: string; | |
| bio?: string; | |
| slug: string; | |
| email?: string; | |
| socials?: Socials; | |
| youtube?: string; | |
| avatar: string; |
| --- | |
| import BaseHead from '../components/BaseHead.astro'; | |
| import Header from '../components/Header.astro'; | |
| import Footer from '../components/Footer.astro'; | |
| import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; | |
| import type { Blog } from '../lib/types'; | |
| import { client } from '../lib/tursoDb'; | |
| import FormattedDate from "../components/FormattedDate.astro"; | |
| let posts: Blog[] = []; |
(index):103 Uncaught (in promise) TypeError: promisify is not a function
at node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/methods/backup.js (backup.js:6:18)
at __require2 (@libsql_client.js?v=282a651a:10:50)
at node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/database.js (database.js:72:29)
at __require2 (@libsql_client.js?v=282a651a:10:50)
at node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/index.js (index.js:2:18)
at __require2 (@libsql_client.js?v=282a651a:10:50)
at node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib/lib/driver/SqliteDriver.js (SqliteDriver.js:43:40)
at __require2 (@libsql_client.js?v=282a651a:10:50)