This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev kysely-codegen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install kysely pg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xata.db['users'].select(['first_name', 'country', 'email']).getMany(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supabase.from('users').select('first_name, country, email'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client.query('SELECT first_name, country, email FROM users'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supabase.from('users').select(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/primitive-toggle-local-storage.tsx | |
'use client'; | |
import { useAtom } from 'jotai'; | |
import { darkModeAtom } from '../state'; | |
export const PrimitiveToggleLocalStorage = () => { | |
const [darkMode, setDarkMode] = useAtom(darkModeAtom); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/state/index.ts | |
import { atom } from 'jotai'; | |
+ import { atomWithStorage } from 'jotai/utils'; | |
export const countAtom = atom(0); | |
export const objectAtom = atom({ | |
foo: 'bar', | |
test: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/layouts/_layout.tsx | |
import { Provider } from 'jotai'; | |
type Props = { | |
children: React.ReactNode; | |
}; | |
const RootLayout: React.FunctionComponent<Props> = async ({ children }) => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/server-read-only-component.tsx | |
'use client'; | |
import { useAtom } from 'jotai'; | |
import { useHydrateAtoms } from 'jotai/utils'; | |
import { userAtom } from '../state'; | |
type Props = { | |
userData: { |