Changes between Version 3 and Version 4 of AddComponent


Ignore:
Timestamp:
12/29/25 11:48:42 (12 hours ago)
Author:
233051
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddComponent

    v3 v4  
    2929RETURNING id AS new_component_id
    3030
    31 -- if type == 'cpu'
     31-- if type == 'cpu':
    3232INSERT INTO cpu (component_id, socket, cores, threads, base_clock, boost_clock, tdp)
    3333VALUES ($new_component_id, $socket, $cores, $threads, $base_clock, $boost_clock, $tdp);
     
    3636VALUES ($new_component_id, $socket);
    3737
    38 -- if type == 'gpu'
     38-- if type == 'gpu':
    3939INSERT INTO gpu (component_id, vram, tdp, base_clock, boost_clock, chipset, length)
    4040VALUES ($new_component_id, $vram, $tdp, $base_clock, $boost_clock, $chipset, $length);
    4141
    42 -- if type == 'memory'
     42-- if type == 'memory':
    4343INSERT INTO memory (component_id, type, speed, capacity, modules)
    4444VALUES ($new_component_id, $memory_type, $speed, $capacity, $modules);
    4545
    46 -- if type == 'storage'
     46-- if type == 'storage':
    4747INSERT INTO storage (component_id, type, capacity, form_factor)
    4848VALUES ($new_component_id, $storage_type, $capacity, $form_factor);
    4949
    50 -- if type == 'power_supply'
     50-- if type == 'power_supply':
    5151INSERT INTO power_supply (component_id, type, wattage, form_factor)
    5252VALUES ($new_component_id, $psu_type, $wattage, $form_factor);
    5353
    54 -- if type == 'motherboard'
     54-- if type == 'motherboard':
    5555INSERT INTO motherboard (component_id, socket, chipset, form_factor, ram_type, num_ram_slots, max_ram_capacity, pci_express_slots)
    5656VALUES ($new_component_id, $socket, $chipset, $form_factor, $ram_type, $num_ram_slots, $max_ram_capacity, $pci_express_slots);
    5757
    58 -- if type == 'case'
     58-- if type == 'case':
    5959INSERT INTO pc_case (component_id, cooler_max_height, gpu_max_length)
    6060VALUES ($new_component_id, $cooler_max_height, $gpu_max_length);
     
    6969VALUES ($new_component_id, $mf_form_factor);
    7070
    71 -- if type == 'cooler'
     71-- if type == 'cooler':
    7272INSERT INTO cooler (component_id, type, height, max_tdp_supported)
    7373VALUES ($new_component_id, $cooler_type, $height, $max_tdp_supported);
    7474
    75 -- if type == 'memory_card'
     75-- if type == 'memory_card':
    7676INSERT INTO memory_card (component_id, num_slots, interface)
    7777VALUES ($new_component_id, $num_slots, $interface);
    7878
    79 -- if type == 'optical_drive'
     79-- if type == 'optical_drive':
    8080INSERT INTO optical_drive (component_id, form_factor, type, interface, write_speed, read_speed)
    8181VALUES ($new_component_id, $form_factor, $optical_type, $interface, $write_speed, $read_speed);
    8282
    83 -- if type == 'sound_card'
     83-- if type == 'sound_card':
    8484INSERT INTO sound_card (component_id, sample_rate, bit_depth, chipset, interface, channel)
    8585VALUES ($new_component_id, $sample_rate, $bit_depth, $chipset, $interface, $channel);
    8686
    87 -- if$type == 'cables'
     87-- if$type == 'cables':
    8888INSERT INTO cables (component_id, length_cm, type)
    8989VALUES ($new_component_id, $length_cm, $cable_type);
    9090
    91 -- if type == 'network_adapter'
     91-- if type == 'network_adapter':
    9292INSERT INTO network_adapter (component_id, wifi_version, interface, num_antennas)
    9393VALUES ($new_component_id, $wifi_version, $interface, $num_antennas);
    9494
    95 -- if type == 'network_card'
     95-- if type == 'network_card':
    9696INSERT INTO network_card (component_id, num_ports, speed, interface)
    9797VALUES ($new_component_id, $num_ports, $speed, $interface);