Changes between Version 3 and Version 4 of AddComponent
- Timestamp:
- 12/29/25 11:48:42 (12 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddComponent
v3 v4 29 29 RETURNING id AS new_component_id 30 30 31 -- if type == 'cpu' 31 -- if type == 'cpu': 32 32 INSERT INTO cpu (component_id, socket, cores, threads, base_clock, boost_clock, tdp) 33 33 VALUES ($new_component_id, $socket, $cores, $threads, $base_clock, $boost_clock, $tdp); … … 36 36 VALUES ($new_component_id, $socket); 37 37 38 -- if type == 'gpu' 38 -- if type == 'gpu': 39 39 INSERT INTO gpu (component_id, vram, tdp, base_clock, boost_clock, chipset, length) 40 40 VALUES ($new_component_id, $vram, $tdp, $base_clock, $boost_clock, $chipset, $length); 41 41 42 -- if type == 'memory' 42 -- if type == 'memory': 43 43 INSERT INTO memory (component_id, type, speed, capacity, modules) 44 44 VALUES ($new_component_id, $memory_type, $speed, $capacity, $modules); 45 45 46 -- if type == 'storage' 46 -- if type == 'storage': 47 47 INSERT INTO storage (component_id, type, capacity, form_factor) 48 48 VALUES ($new_component_id, $storage_type, $capacity, $form_factor); 49 49 50 -- if type == 'power_supply' 50 -- if type == 'power_supply': 51 51 INSERT INTO power_supply (component_id, type, wattage, form_factor) 52 52 VALUES ($new_component_id, $psu_type, $wattage, $form_factor); 53 53 54 -- if type == 'motherboard' 54 -- if type == 'motherboard': 55 55 INSERT INTO motherboard (component_id, socket, chipset, form_factor, ram_type, num_ram_slots, max_ram_capacity, pci_express_slots) 56 56 VALUES ($new_component_id, $socket, $chipset, $form_factor, $ram_type, $num_ram_slots, $max_ram_capacity, $pci_express_slots); 57 57 58 -- if type == 'case' 58 -- if type == 'case': 59 59 INSERT INTO pc_case (component_id, cooler_max_height, gpu_max_length) 60 60 VALUES ($new_component_id, $cooler_max_height, $gpu_max_length); … … 69 69 VALUES ($new_component_id, $mf_form_factor); 70 70 71 -- if type == 'cooler' 71 -- if type == 'cooler': 72 72 INSERT INTO cooler (component_id, type, height, max_tdp_supported) 73 73 VALUES ($new_component_id, $cooler_type, $height, $max_tdp_supported); 74 74 75 -- if type == 'memory_card' 75 -- if type == 'memory_card': 76 76 INSERT INTO memory_card (component_id, num_slots, interface) 77 77 VALUES ($new_component_id, $num_slots, $interface); 78 78 79 -- if type == 'optical_drive' 79 -- if type == 'optical_drive': 80 80 INSERT INTO optical_drive (component_id, form_factor, type, interface, write_speed, read_speed) 81 81 VALUES ($new_component_id, $form_factor, $optical_type, $interface, $write_speed, $read_speed); 82 82 83 -- if type == 'sound_card' 83 -- if type == 'sound_card': 84 84 INSERT INTO sound_card (component_id, sample_rate, bit_depth, chipset, interface, channel) 85 85 VALUES ($new_component_id, $sample_rate, $bit_depth, $chipset, $interface, $channel); 86 86 87 -- if$type == 'cables' 87 -- if$type == 'cables': 88 88 INSERT INTO cables (component_id, length_cm, type) 89 89 VALUES ($new_component_id, $length_cm, $cable_type); 90 90 91 -- if type == 'network_adapter' 91 -- if type == 'network_adapter': 92 92 INSERT INTO network_adapter (component_id, wifi_version, interface, num_antennas) 93 93 VALUES ($new_component_id, $wifi_version, $interface, $num_antennas); 94 94 95 -- if type == 'network_card' 95 -- if type == 'network_card': 96 96 INSERT INTO network_card (component_id, num_ports, speed, interface) 97 97 VALUES ($new_component_id, $num_ports, $speed, $interface);
