Skip to content

Releases: rphlmr/drizzle-lab

0.8.5

29 Aug 12:28
0aca064
Compare
Choose a tag to compare

What's Changed

Missed what happened in 0.8.0?

https://github.com/rphlmr/drizzle-run/releases/tag/v0.8.2

Fixes

  • relation "xxx" already exists is now fixed

0.8.3

25 Aug 18:10
0aca064
Compare
Choose a tag to compare

What's Changed

PGlite 0.2.3

You can now use vector in your playgrounds!

🔥 Missed what happened in 0.8.0?

https://github.com/rphlmr/drizzle-run/releases/tag/v0.8.2

Breaking changes

PGlite 0.1.5 to 0.2.3

There is a breaking change in the internal schema of PGlite for IndexedDB.
Your local playgrounds have been migrated. If data has been lost, check in local storage, there is a backup.

0.8.2

24 Aug 17:45
0aca064
Compare
Choose a tag to compare

What's Changed

Hey 👋 massive new things for this release!

Seed tab

You can now put all your seed data in this tab.
It is included when you share your playground and it will run just before executing your code. 🚀
CleanShot 2024-08-24 at 18 01 40@2x

New super fast code runner

I have written a new custom code runner. Your playgrounds now execute instantly 🚀
Works on all browsers (including Safari)
Outputs now display which file produced them.
Previous outputs of a run are now hidden. You can still view them by selecting previous run results. (#3)
It implements a fork of Drizzle Kit. Feel free to open an issue if something is not working.
CleanShot 2024-08-24 at 18 02 14@2x

Visualize your playgrounds

Drizzle Visualizer has been added to all playgrounds.
CleanShot 2024-08-24 at 18 03 45@2x

Explore 🔭

You can now view all shared playgrounds and search by keyword or dialect.
CleanShot 2024-08-24 at 18 02 37@2x

Convert

Experimental Drizzle to SQL and SQL to Drizzle.
Write the code, get instant conversion.
Again, it is based on a fork of Drizzle Kit.
CleanShot 2024-08-24 at 18 03 03@2x
CleanShot 2024-08-24 at 18 03 12@2x

Resize!

You can now resize the playground workspace as you want!
#2

Breaking changes

Faker has been removed

I have removed Faker ($.faker) and replaced it with a custom ultra-light one: $.random

/**
   * Generates a random UUID
   */
  uuid() {
    return crypto.randomUUID();
  },
  /**
   * Generates a random integer between min and max
   * @param min The minimum value (default: -10_000)
   * @param max The maximum value (default: 10_000)
   */
  integer(min = -10_000, max = 10_000) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
  },
  /**
   * Generates a sequence of integers from 0 to length - 1
   * @param length The length of the array
   *
   * @example
   * ```
   * $.random.sequence(5) // [0, 1, 2, 3, 4]
   * ```
   */
  sequence(length: number) {
    return Array.from({ length }, (_, i) => i);
  },
  /**
   * Generates a random decimal between min and max
   * @param min The minimum value (default: -10_000)
   * @param max The maximum value (default: 10_000)
   */
  decimal(min = -10_000, max = 10_000) {
    return (Math.random() * (max - min) + min).toFixed(2);
  },
  /**
   * Generates a random string of lorem ipsum words
   * @param wordCount The number of words to generate (default: 5)
   */
  lorem(wordCount: number = 5): string {
    return Array.from({ length: wordCount }, () => loremWords[Math.floor(Math.random() * loremWords.length)]).join(" ");
  },
  /**
   * Generates a random first name
   */
  firstName(): string {
    return firstNames[Math.floor(Math.random() * firstNames.length)];
  },
  /**
   * Generates a random last name
   */
  lastName(): string {
    return lastNames[Math.floor(Math.random() * lastNames.length)];
  },
  /**
   * Generates a random full name
   */
  fullName(): string {
    return `${this.firstName()} ${this.lastName()}`;
  },
  /**
   * Generates a random email address
   */
  email(): string {
    const chars = "abcdefghijklmnopqrstuvwxyz";
    const length = this.integer(5, 10);
    let result = "";
    for (let i = 0; i < length; i++) {
      result += chars.charAt(Math.floor(Math.random() * chars.length));
    }
    const number = this.integer(0, 999);
    return `${result}${number}@email.com`;
  },
  /**
   * Generates a random date between start and end
   * @param start The start date (default: 1970-01-01)
   * @param end The end date (default: current date)
   */
  date(start: Date = new Date(1970, 0, 1), end: Date = new Date()): Date {
    return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
  },
  /**
   * Generates a random URL
   */
  url(): string {
    const domainName = this.lorem(1).toLowerCase();
    return `https://www.${domainName}.com`;
  },
  /**
   * Generates a random image URL
   */
  imageUrl(): string {
    const id = this.integer(0, 99);
    return `https://picsum.photos/id/${id}/200/200`;
  },
  /**
   * Generates an array
   * @param length The length of the array
   * @param generator The generator function
   *
   * @example
   * ```
   * $.random.array(4, $.random.date)
   * ```
   */
  array<T extends () => unknown>(length: number, generator: T) {
    return Array.from({ length }, () => generator()) as ReturnType<T>[];
  },

0.7.1

24 Aug 14:52
0aca064
Compare
Choose a tag to compare

0.6.1

02 Aug 19:25
0aca064
Compare
Choose a tag to compare

What's Changed

  • Add missing SQLite support 😅

Fixes

  • In some conditions, it was impossible to create a visualization.

0.6.0

02 Aug 17:20
0aca064
Compare
Choose a tag to compare

What's Changed

Hey 👋 some new things for this release!

Drizzle schema visualizer (wip)

(#21 ) You can now visualize your schema and export it as a PNG.
👉 Try it!
CleanShot 2024-08-02 at 19 17 07@2x

Fixes

  • (#12) Memory leak in @vercel/og should be patched
diff --git a/node_modules/@vercel/og/dist/index.node.js b/node_modules/@vercel/og/dist/index.node.js
index c92983c..ac1bb7c 100644
--- a/node_modules/@vercel/og/dist/index.node.js
+++ b/node_modules/@vercel/og/dist/index.node.js
@@ -18786,7 +18786,11 @@ async function render(satori2, resvg, opts, defaultFonts, element) {
       value: options.width
     }
   });
-  return resvgJS.render().asPng();
+   const pngData = resvgJS.render();
+   const pngBuffer = pngData.asPng();
+   pngData.free();
+   resvgJS.free();
+   return pngBuffer;
 }
 
 // src/figma/index.tsx

0.5.0

12 Jul 16:33
0aca064
Compare
Choose a tag to compare

What's Changed

Hey 👋 some new things for this release!

Goodies in Schema

(#20) You can now use $.faker for $default and $defaultFn

  name: text("name")
    .notNull()
    .$defaultFn(() => $.faker.person.lastName())

New Drizzle extensions

drizzle-zod and drizzle-valibot are now available in all playgrounds (#16)

UI reworks

Playgrounds list

You can now identify which playground is shared (you can filter on the keyword shared)

CleanShot 2024-07-12 at 15 05 58@2x

Share button

The share button has been reworked to easily reflect its status

CleanShot 2024-07-12 at 14 57 59@2x
CleanShot 2024-07-12 at 14 58 12@2x

Publish button (shared playgrounds)

The publish button has been reworked to draw your attention to the fact that your shared playground has some pending changes that have not been pushed.

CleanShot 2024-07-12 at 14 58 27@2x

Discard local changes (shared playgrounds)

You can now discard local changes that have not been pushed and revert to the server version.

CleanShot 2024-07-12 at 14 59 02@2x

Catch playground execution error

Some users can face cryptic errors when they miss some awaits on async function calls.
Now we try to help you.

CleanShot 2024-07-12 at 14 57 01@2x

New formatter

The default formatter has been replaced with prettier

0.4.0

10 Jul 16:49
0aca064
Compare
Choose a tag to compare

0.3.0

07 Jul 17:14
0aca064
Compare
Choose a tag to compare

What's Changed

  • Add labels to buttons (Publish and Share)
  • Fix an issue where the last output was not selectable

0.2.1

04 Jul 15:11
0aca064
Compare
Choose a tag to compare

What's Changed

  • Fix: SQLite not working on Firefox (#14)
  • Fix: Output is not always displayed after a run (#15)