pocketbase-import/types/pocketbase.ts
michal-kapala ac857af125 basic csv support
+ csv imports
+ import options
+ type detection
+ bool, number, date, text, email and json types supported
2023-03-06 01:39:18 +01:00

35 lines
681 B
TypeScript

/**
* All the Pocketbase types supported by this tool.
*/
export const POCKETBASE_TYPE = {
BOOL: "bool",
NUMBER: "number",
PLAIN_TEXT: "text",
EMAIL: "email",
JSON: "json",
DATETIME: "date",
} as const;
type ObjectValues<T> = T[keyof T];
/**
* Supported Pocketbase data types.
*/
export type PocketbaseType = ObjectValues<typeof POCKETBASE_TYPE>;
/**
* A row type schema for column value parsing.
*/
export type PocketbaseRowSchema = {
[key: string]: PocketbaseType;
};
/**
* PocketBase system fields with autogenerated values that cannot be overriden (`base` collection type).
*/
export const POCKETBASE_SYSFIELD = [
"id",
"created",
"updated",
];