{"id":49,"date":"2024-05-01T23:56:55","date_gmt":"2024-05-01T23:56:55","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/aicoder\/?p=49"},"modified":"2024-05-01T23:56:55","modified_gmt":"2024-05-01T23:56:55","slug":"michael-kozub-week-3","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/aicoder\/2024\/05\/01\/michael-kozub-week-3\/","title":{"rendered":"Michael Kozub &#8211; Week 3"},"content":{"rendered":"\n<p>So far ChatGPT has done a great job creating MySQL table tables and general SQL statements. This week I used GPT to create more tables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>brokerage_connections<\/li>\n\n\n\n<li>orders<\/li>\n\n\n\n<li>notifications<\/li>\n<\/ul>\n\n\n\n<p>I ran into some issues with it creating primary and foreign keys, mostly due to my impatience with how to correctly write this in GPT format, so I took over and manually created those relationships in MySQLWorkbench since it was much faster.<\/p>\n\n\n\n<p>I also used ChatGPT to help me create some dummy data with real Firebase Id\u2019s that were generated by creating users in our Firebase data.<\/p>\n\n\n\n<p>Then I hopped over to the brokerageLinkPage (the page that shows a list of brokerages you can connect to our app). This was my first time trying to update an existing file that I pasted into ChatGPT. I tried to have GPT update our existing code to have an onClick handler and print a simple console log. ChatGPT fell short and threw me for a loop for a few hours due to one line missing: \u2018use client\u2019. I had to manually resolve this issue even after Googling what the issue was. Apparently ChatGPT isn\u2019t aware of how to include this statement in React\/Next.js code. This wasn\u2019t a big deal at the end of the day but it took some manual debugging to figure out what was going on.<\/p>\n\n\n\n<p>After getting the console.log to work when tapping on a brokerage, I was able to have ChatGPT write some code that opens the Alpaca login\/signup page in a new tab. Next week I will look into how to get this window to open in the existing tab (such as an iframe?) but I will have a chat with ChatGPT to see what best practices are.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So far ChatGPT has done a great job creating MySQL table tables and general SQL statements. This week I used GPT to create more tables: I ran into some issues with it creating primary and foreign keys, mostly due to my impatience with how to correctly write this in GPT format, so I took over [&hellip;]<\/p>\n","protected":false},"author":14279,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-project-progress-reports"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/users\/14279"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/49\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}