string()

Define a string type


Usage

User.js
import { Model } from 'pinia-orm'class User extends Model {  static entity = 'users'  static fields () {    return {      id: this.number(0),      name: this.string('')    }  }}

With Decorator

User.ts
import { Model, Num, Str } from 'pinia-orm'class User extends Model {  static entity = 'users'    @Num(0) id!: number  @Str('') name!: string}

Typescript Declarations

function string(value: string | null): String