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 } from 'pinia-orm'import { Num, Str } from 'pinia-orm/dist/decorators'class User extends Model {  static entity = 'users'    @Num(0) declare id: number  @Str('') declare name: string}

Typescript Declarations

function string(value: string | null): String