---
title: "Persist Data in Deno with npm using Prisma, Mongoose, Apollo, and more."
description: "Deno's npm: specifiers let you use popular data-layer packages directly, with Deno's opt-in permission flags limiting what a possibly compromised dependency can reach, such as environment variables holding database credentials."
url: "https://swe.quest/articles/persist-data-in-deno-with-npm-using-prisma-mongoose-apollo-and-more-93a981bba3f6dd39"
canonical: "https://deno.com/blog/persistent-data-npm"
source: "Deno"
published: "2022-11-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["javascript","typescript","databases","graphql"]
---

# Persist Data in Deno with npm using Prisma, Mongoose, Apollo, and more.

A post on [Deno](https://swe.quest/sources/deno.md), published 2022-11-15, 7 min read, How-to. Original: [https://deno.com/blog/persistent-data-npm](https://deno.com/blog/persistent-data-npm)

## Summary

Deno's npm: specifiers let you use popular data-layer packages directly, with Deno's opt-in permission flags limiting what a possibly compromised dependency can reach, such as environment variables holding database credentials. Three quick-start walkthroughs follow. Prisma is initialized against a Supabase PostgreSQL database and routed through Prisma Data Platform's Data Proxy. A Mongoose schema with validations writes to and reads from MongoDB. An Apollo GraphQL server defines typeDefs and resolvers over a static dataset.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [GraphQL](https://swe.quest/tags/graphql.md) (Backend & APIs)

## Prerequisites

- TypeScript basics ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- ORM concepts
- GraphQL basics ([easy posts on GraphQL](https://swe.quest/tags/graphql.md?difficulty=easy))

## Keywords

Deno, Prisma, Mongoose, Apollo Server, MongoDB, PostgreSQL, npm, Supabase

## Related posts

- [How to Build a GraphQL Server with Deno](https://swe.quest/articles/how-to-build-a-graphql-server-with-deno-b4bf15abf8edf07f.md): Deno · 2023-01-11 · Medium · 7 min read · GraphQL, TypeScript, PostgreSQL, API design
  A GraphQL API server can be built in Deno with the std HTTP Server, the gql middleware, graphql\_tools' makeExecutableSchema and graphql\_tag.
- [Build a Database App with Drizzle ORM and Deno](https://swe.quest/articles/build-a-database-app-with-drizzle-orm-and-deno-692f9df52f193839.md): Deno · 2024-11-13 · Medium · 7 min read · TypeScript, PostgreSQL, JavaScript, Schema migrations
  Drizzle ORM can be used from Deno via npm compatibility to get type-safe CRUD access to PostgreSQL.
- [Edge Functions: Node and native npm compatibility](https://swe.quest/articles/edge-functions-node-and-native-npm-compatibility-4f29863e45494db0.md): Supabase · 2023-12-12 · Medium · 3 min read · Serverless, JavaScript, Observability
  Supabase Edge Functions now natively support npm modules (via \`npm:\` imports) and Node built-in APIs, so existing Node apps using Express, node-postgres and Drizzle can migrate with minimal changes.
- [Using Supabase in Replit](https://swe.quest/articles/using-supabase-in-replit-72c3911510319276.md): Supabase · 2021-03-11 · Medium · 3 min read · JavaScript, Databases, PostgreSQL
  Supabase can serve as a hosted Postgres database for Node.js repls on Replit, queried directly through supabase-js.
- [Cal.com launches Expert Marketplace built with Next.js and Supabase.](https://swe.quest/articles/cal-com-launches-expert-marketplace-built-with-next-js-and-supabase-2659e9baa272f3f6.md): Supabase · 2024-06-18 · Medium · 5 min read · PostgreSQL, Frontend, Serverless, Storage systems
  Cal.com's open-source Platform Starter Kit for building expert marketplaces runs on Next.js and Supabase, having switched from SQLite to Postgres via Prisma shortly before launch once file storage was needed.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
