Zod Schema: How to make a field optional OR have a minimum string contraint?

In your case, you consider “” to be the same as undefined (i.e.: when the string is empty, it’s like there’s no string at all). It’s implementable in Zod this way: import { z } from “zod”; import { strict as assert } from “node:assert”; // `myString` is a string that can be either optional … Read more

What version numbering scheme to use?

I would recommend the Semantic Versioning standard, which the Maven versioning system also appears to follow. Please check out, http://semver.org/ In short it is <major>.<minor>.<patch><anything_else>, and you can add additional rules to the anything else part as seems fit to you. eg. -<qualifier>-<build_number>.

Generating an image of a database schema used in a Rails app

Have you tried rake db:schema:dump? Essentially, make sure that your database.yml file is referencing the database you wish to dump, and then run the command. It’ll take all of the tables and indexes in said database and then write it out to schema.rb. Note that you should rename schema.rb once it contains the dump; otherwise, … Read more

Choice of Database schema for storing folder system

Your first schema will work just fine. When you put an index on the FullPath column, use either the case-sensitive BETWEEN operator for queries, or use LIKE with either COLLATE NOCASE on the index or with PRAGMA case_sensitive_like. Please note that this schema also stores all parents, but the IDs (the names) are all concatenated … Read more

Designing a SQL schema for a combination of many-to-many relationship (variations of products)

Applying normalization to your problem, the solution is as given. Run and see it on SQL Fiddle. CREATE TABLE products ( product_id int AUTO_INCREMENT PRIMARY KEY, name varchar(20), description varchar(30) ); INSERT INTO products (name, description) VALUES (‘Rug’, ‘A cool rug’ ), (‘Cup’, ‘A coffee cup’); — ======================================== CREATE TABLE variants ( variant_id int AUTO_INCREMENT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)