mirror of
				https://github.com/chartdb/chartdb.git
				synced 2025-11-03 21:43:23 +00:00 
			
		
		
		
	validate same field types when connecting
This commit is contained in:
		@@ -140,7 +140,10 @@ export const ChartDBProvider: React.FC<React.PropsWithChildren> = ({
 | 
			
		||||
                {
 | 
			
		||||
                    id: generateId(),
 | 
			
		||||
                    name: 'id',
 | 
			
		||||
                    type: 'bigint',
 | 
			
		||||
                    type:
 | 
			
		||||
                        databaseType === DatabaseType.SQLITE
 | 
			
		||||
                            ? 'integer'
 | 
			
		||||
                            : 'bigint',
 | 
			
		||||
                    unique: true,
 | 
			
		||||
                    nullable: false,
 | 
			
		||||
                    primaryKey: true,
 | 
			
		||||
@@ -155,7 +158,7 @@ export const ChartDBProvider: React.FC<React.PropsWithChildren> = ({
 | 
			
		||||
        await addTable(table);
 | 
			
		||||
 | 
			
		||||
        return table;
 | 
			
		||||
    }, [addTable, tables]);
 | 
			
		||||
    }, [addTable, tables, databaseType]);
 | 
			
		||||
 | 
			
		||||
    const getTable: ChartDBContext['getTable'] = useCallback(
 | 
			
		||||
        (id: string) => tables.find((table) => table.id === id) ?? null,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user