Kaizen Today I Learned by Ville Säävuori

Posts tagged howto

Typing Firebase Database Queries With TypeScript

Document databases like Firebase work great with JavaScript but they can get really messy really fast if you’re not very strict with your data models. TypeScript is the perfect companion here and luckily the Firebase database functions can be easily typed in a way that will help you to keep your data consistent.

· Read the full article →

Narrowing unknown type in TypeScript

Type narrowing is one of the most useful and powerful features of TypeScript. Sometimes, however, it can be a bit too complicated. Consider this simple function that uses Firebase: export const useSignOut = async () => { try { const auth = getAuth() await signOut(auth) } catch (err: any) { alert(err.

· Read the full article →

How to migrate MySQL database to PostgreSQL

I’ve migrated a couple of old Django projects from MySQL to PostgreSQL lately and decided to document the process here to help make it go faster in the future. If your old database is not exotic in any way the migration process is pretty fast and simple. The hard part is figuring out how and how much you should tweak in the old database to get rid of warnings/errors if there are some.

· Read the full article →