microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.53k stars 29.4k forks source link

Python use debug sqlite foreign key do not work #180195

Closed spaceNavy closed 1 year ago

spaceNavy commented 1 year ago

Type: Bug

if you use debug and run button to run your python script, sqlite foreign key do not work, but you run python in terminal, the foreign key work again!

VS Code version: Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c, 2022-09-01T07:36:10.600Z) OS version: Windows_NT x64 10.0.22000 Modes: Unsupported Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 6800H with Radeon Graphics (16 x 3194)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.19GB (4.02GB free)| |Process Argv|E:\\1-code\\003-general-auth --crash-reporter-id 7563968f-7968-4b45-b698-95b5d50b7118| |Screen Reader|no| |VM|0%|
Extensions (31) Extension|Author (truncated)|Version ---|---|--- vscode-sqlite|ale|0.14.1 QML|bbe|1.0.0 vscode-live2d|Cha|1.8.1 npm-intellisense|chr|1.4.4 keil-assistant|cl|1.7.0 doxdocgen|csc|1.4.0 vscode-mysql-client2|cwe|6.3.8 vscode-eslint|dba|2.4.0 rainbow-fart-waifu|ezs|0.0.20 go|gol|0.38.0 gc-excelviewer|Gra|4.2.57 vscode-drawio|hed|1.6.6 plantuml|jeb|2.17.5 better-cpp-syntax|jef|1.17.2 svg|joc|1.5.2 vscode-codemetrics|kis|1.24.0 asm-code-lens|maz|2.4.1 python-path|mge|0.0.14 vscode-docker|ms-|1.23.3 vscode-language-pack-zh-hans|MS-|1.72.10121008 python|ms-|2022.16.1 vscode-pylance|ms-|2023.1.10 cmake-tools|ms-|1.13.45 cpptools|ms-|1.14.5 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.9 powershell|ms-|2023.3.3 vscode-qt-for-python|sea|7.3.2 cmake|twx|0.0.17 volar|Vue|1.2.0 vscode-typescript-vue-plugin|Vue|1.2.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vscaac:30438847 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 nodejswelcome1:30587005 2e4cg342:30602488 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 vscodedisable:30660115 azdwalk:30687957 pythonms35:30701012 pythonfmttext:30716742 pythonclientmv:30713943 ```
vscodenpa commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.77.3. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

spaceNavy commented 1 year ago

I update the app to 1.77.3, but after I restart the app, the app is black. image and nothine to show!

spaceNavy commented 1 year ago

I try to use 1.77.2, but the sqlite foreign key is always do not work.

roblourens commented 1 year ago

Sorry, I don't really understand the issue, it sounds like there might be an issue with your configuration. But if you think vscode is doing the wrong thing then please open an issue with more details on the python extension repo

spaceNavy commented 1 year ago

Sorry, I found the real reason for this situation. it is not vscode bug. I make a virtual environment, and the vscode debug config do not use the virtual env but the global env, probably because sqlalchemy. Thank you very much for my issue.