<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Monte Logic</title>
    <description>The latest articles on DEV Community by Monte Logic (@montelogic).</description>
    <link>https://dev.to/montelogic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F916127%2F94d6d7d9-2716-4482-b5c5-319a7690d24c.jpeg</url>
      <title>DEV Community: Monte Logic</title>
      <link>https://dev.to/montelogic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/montelogic"/>
    <language>en</language>
    <item>
      <title>Setting Up Turso with Next.js and Prisma</title>
      <dc:creator>Monte Logic</dc:creator>
      <pubDate>Fri, 18 Oct 2024 20:04:01 +0000</pubDate>
      <link>https://dev.to/montelogic/setting-up-turso-with-nextjs-and-prisma-3843</link>
      <guid>https://dev.to/montelogic/setting-up-turso-with-nextjs-and-prisma-3843</guid>
      <description>&lt;p&gt;There are two ways which you can use Turso, locally and through a connection&lt;/p&gt;

&lt;p&gt;Locally:&lt;/p&gt;

&lt;p&gt;datasource db {&lt;br&gt;
  provider = "sqlite"&lt;br&gt;
  url      = "file:./dev.db"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Once you run, npx prisma generate, your dev.db file should be created and you’re ready for local development.&lt;/p&gt;

&lt;p&gt;Through a connection (Turso’s db)&lt;/p&gt;

&lt;p&gt;In order to do it through a connection we need to install the Turso CLI. Installing the CLI, should be a simple process, with the official instructions.&lt;br&gt;
Understanding the limitations.&lt;/p&gt;

&lt;p&gt;“Since libSQL uses HTTP to connect to the remote database, this makes it incompatible with Prisma Migrate. However, you can use prisma migrate diff to create a schema migration and then apply the changes to your database using Turso’s CLI.&lt;/p&gt;

&lt;p&gt;“&lt;/p&gt;

&lt;p&gt;This messes up the Developer Experience but with most of the work being focused on Drizzle lets be glad that we have workarounds to use Prisma.&lt;/p&gt;

&lt;p&gt;We wrote down the migration script which can be found in the official video on using Prisma with Turso.&lt;/p&gt;

&lt;p&gt;npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script &amp;gt; baseline.sql&lt;/p&gt;

&lt;p&gt;The above command will create a .sql file called baseline.sql.&lt;/p&gt;

&lt;p&gt;Then, we run this command:&lt;/p&gt;

&lt;p&gt;turso db shell your-database &amp;lt; baseline.sql&lt;/p&gt;

&lt;p&gt;Connecting with libraries&lt;/p&gt;

&lt;p&gt;The two libraries we need can be downloaded with this command:&lt;/p&gt;

&lt;p&gt;npm install @libsql/client @prisma/adapter-libsql&lt;/p&gt;

&lt;p&gt;To push the db, run:&lt;/p&gt;

&lt;p&gt;npx prisma db push &lt;/p&gt;

&lt;p&gt;After all of this your Turso with Next.js and Prisma app should work fine.&lt;br&gt;
Errors:&lt;/p&gt;

&lt;p&gt;“Error: failed to execute SQL:&lt;br&gt;
error code 401: Not authorized to execute query: DDL statements not permitted on namespace f16a969f-77b1-4020-9701-b595ea037277″&lt;/p&gt;

&lt;p&gt;Fix: Be careful so that your are operating db schema, not the db which is a “child db”. Again, operate on the schema level db.&lt;br&gt;
To Conclude,&lt;/p&gt;

&lt;p&gt;I would not recommend using Turso with Prisma, it is much better to use Turso with Drizzle. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Best Next.js Devs who create content</title>
      <dc:creator>Monte Logic</dc:creator>
      <pubDate>Wed, 27 Mar 2024 15:42:22 +0000</pubDate>
      <link>https://dev.to/montelogic/best-nextjs-devs-who-create-content-3jn0</link>
      <guid>https://dev.to/montelogic/best-nextjs-devs-who-create-content-3jn0</guid>
      <description>&lt;p&gt;As you get climb the ladder of skills it becomes harder and harder to get higher and higher. &lt;/p&gt;

&lt;p&gt;The people you can gain lots of knowledge becomes shorter and shorter, so here are the devs that I view have spent at least 10,000 hours on the Next.js stack or closely related stacks to call themselves an Expert or a Master in Next.js. &lt;/p&gt;

&lt;p&gt;Remi Wg&lt;br&gt;
&lt;a href="https://dev.to/ixartz"&gt;https://dev.to/ixartz&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cosden Solutions&lt;br&gt;
&lt;a href="https://cosden.solutions/"&gt;https://cosden.solutions/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Gemini is hot garbage for writing code.</title>
      <dc:creator>Monte Logic</dc:creator>
      <pubDate>Sun, 25 Feb 2024 17:13:28 +0000</pubDate>
      <link>https://dev.to/montelogic/gemini-is-hot-garbage-for-writing-code-10hp</link>
      <guid>https://dev.to/montelogic/gemini-is-hot-garbage-for-writing-code-10hp</guid>
      <description>&lt;p&gt;The fact that Google can put that LLM out and even hint at it being able to write code is making us as a tech industry lose credibility. &lt;/p&gt;

&lt;p&gt;Look at these prompts and how Gemini isn't doing anything but stating the obvious. &lt;/p&gt;

&lt;p&gt;"&lt;br&gt;
profile picture&lt;br&gt;
For this:&lt;br&gt;
"&lt;br&gt;
{&lt;br&gt;
    "midDay": [],&lt;br&gt;
    "afternoon": [],&lt;br&gt;
    "midMorning": [&lt;br&gt;
        "Today, we had more issues with the lift gate and we were 25 minutes late arriving to the post office and 20 minutes late, finishing the route. "&lt;br&gt;
    ],&lt;br&gt;
    "earlyMorning": []&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Me:&lt;br&gt;
"&lt;br&gt;
And two image urls to midMorning which will be accessed via midMorning["imgURL"'][0]&lt;br&gt;
The variables will be set using setState in .tsx. &lt;br&gt;
"&lt;br&gt;
Gemini:&lt;br&gt;
"&lt;br&gt;
I'd be glad to help you with that! However, I need some clarification to provide the best possible assistance:&lt;/p&gt;

&lt;p&gt;Clarification Needed:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Purpose of the Data: What is the overall goal of storing this information about delivery delays in different timeframes? Is it for tracking performance, reporting to clients, or something else? Understanding the purpose will help tailor the solution accordingly.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;"&lt;br&gt;
Me:&lt;br&gt;
"&lt;br&gt;
"   const [summaryObject, setSummaryObject] = useState(null); // Initialize with null&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                   &amp;lt;textarea
                       className="text-gray-900"
                       id="newSummaryInputID"
                       name="newSummaryInputName"
                       value={summaryObject &amp;amp;&amp;amp; summaryObject.earlyMorning} // Check if routeSummary is not null before accessing routeSummary.routeSummary
                       onChange={(e) =&amp;gt; {
                           // Ensure setRouteSummary is updating the state correctly
                           setSummaryObject((prevSummaryObject: ObjectSummary | null) =&amp;gt; ({
                               ...prevSummaryObject,
                               earlyMorning: [e.target.value],
                               midMorning: prevSummaryObject?.midMorning ?? [], // Ensure midMorning is always an array
                               midDay: prevSummaryObject?.midDay ?? [], // Ensure midDay is always an array
                               afternoon: prevSummaryObject?.afternoon ?? [], // Ensure afternoon is always an array
                           }));
                       }}
                   /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;"&lt;/p&gt;

&lt;p&gt;Gemini:&lt;br&gt;
"&lt;br&gt;
The provided code snippet shows how to manage a state object named summaryObject using the useState hook in React. It also demonstrates the usage of a controlled textarea component. While I don't have the full context of your application, I can offer some analysis and suggestions based on the provided code:&lt;/p&gt;

&lt;p&gt;"&lt;/p&gt;

&lt;p&gt;All that crap and not a single line of code wrote, meanwhile OLD ChatGPT is offering way better suggestions. &lt;br&gt;
I asked ChatGPT the same thing and it provided a useful interface among many other USEFUL things.&lt;br&gt;
The interface:&lt;br&gt;
"&lt;br&gt;
interface ObjectSummary {&lt;br&gt;
    midDay: string[];&lt;br&gt;
    afternoon: string[];&lt;br&gt;
    midMorning: { text: string; imgURL?: string }[];&lt;br&gt;
    earlyMorning: string[];&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;"&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
