You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Server: Add function to get db default value
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -75,6 +75,14 @@ export function changeTypeToString(t: ChangeType): string { | ||||
| 	throw new Error(`Unkown type: ${t}`); | ||||
| } | ||||
|  | ||||
| export const getDefaultValue = (tableName: string, colName: string): string|number|null => { | ||||
| 	const table = databaseSchema[tableName]; | ||||
| 	if (!table) throw new Error(`Invalid table name: ${tableName}`); | ||||
| 	const col = table[colName]; | ||||
| 	if (!col) throw new Error(`Invalid column name: ${tableName}.${colName}`); | ||||
| 	return col.defaultValue; | ||||
| }; | ||||
|  | ||||
| export enum ShareType { | ||||
| 	Note = 1, // When a note is shared via a public link | ||||
| 	Folder = 3, // When a complete folder is shared with another Joplin Server user | ||||
|   | ||||
		Reference in New Issue
	
	Block a user