<?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>Forem: Abhinav Kulshreshtha</title>
    <description>The latest articles on Forem by Abhinav Kulshreshtha (@abhinav1217).</description>
    <link>https://forem.com/abhinav1217</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%2F213806%2F77cf8539-0679-4506-bac2-f6cd611d857b.jpg</url>
      <title>Forem: Abhinav Kulshreshtha</title>
      <link>https://forem.com/abhinav1217</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/abhinav1217"/>
    <language>en</language>
    <item>
      <title>HELP: Pull schema updates from postgres into elixir app</title>
      <dc:creator>Abhinav Kulshreshtha</dc:creator>
      <pubDate>Tue, 31 Mar 2026 10:47:33 +0000</pubDate>
      <link>https://forem.com/abhinav1217/help-pull-schema-updates-from-postgres-into-elixir-app-4ngn</link>
      <guid>https://forem.com/abhinav1217/help-pull-schema-updates-from-postgres-into-elixir-app-4ngn</guid>
      <description>&lt;p&gt;I have few node microservices connected to single postgres db. I also have an elixir service for realtime message passing between BE and FE. I am now enhancing realtime service with some additional features, so I added ecto and ash_postgres to mix and connected with postgres. &lt;/p&gt;

&lt;p&gt;Since core app is nodejs, I want that to be source of truth for db schema changes, and elixir should pull updated schema into the model layer. &lt;/p&gt;

&lt;p&gt;We have multi schema db, and &lt;code&gt;public schema&lt;/code&gt; would be readonly, and &lt;code&gt;elx schema&lt;/code&gt; would be full access schema for elixir service. &lt;/p&gt;

&lt;p&gt;I tried this using introspex &lt;code&gt;mix ecto.gen.schema --repo RealtimeService.Repo.Public --path lib/realtime_service/ --module-prefix RealtimeService.Db.Public.Models --schema public&lt;/code&gt; and it was able to generate initial schema but it just wrote comments for fields with enums and jsonb objects. Also I could not pull updates again. &lt;/p&gt;

&lt;p&gt;Can someone guide me properly, most of chatgpt answers were wrong, Claude helped a little but now its just imagining things. I might be programmer for decade but I am an elixir newbie. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I need a way to update model layer in elixir app, from db, any changes in db schema even if only needed by elixir app, will be done from node app to maintain single source of truth for db.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Need enums also, jsonb could simply be a map, and I think array were successfully pulled. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I also need to be able to pull schema changes again, without overwriting everything back.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

</description>
      <category>help</category>
      <category>elixir</category>
      <category>architecture</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Help regarding a secure section on Static-Site.</title>
      <dc:creator>Abhinav Kulshreshtha</dc:creator>
      <pubDate>Tue, 15 Aug 2023 05:41:31 +0000</pubDate>
      <link>https://forem.com/abhinav1217/help-regarding-a-secure-section-on-static-site-10b</link>
      <guid>https://forem.com/abhinav1217/help-regarding-a-secure-section-on-static-site-10b</guid>
      <description>&lt;p&gt;I had built a simple hugo blog for my mother, and hosted it with a Forestry.io + Github + Netlify combo. Forestry provided a nice wysiwyg editor to write her blogs, and netlify hooks would generate static site and update the site. &lt;/p&gt;

&lt;p&gt;Now that forestry is gone, I am looking a way to integrate some way of having a secure page where I can self host a cms like setup. How do I do it, in Static-site? There is no backend server for it.&lt;/p&gt;

</description>
      <category>help</category>
      <category>netlify</category>
    </item>
    <item>
      <title>Can someone explain this Kotlin expression.</title>
      <dc:creator>Abhinav Kulshreshtha</dc:creator>
      <pubDate>Sat, 05 Oct 2019 16:11:20 +0000</pubDate>
      <link>https://forem.com/abhinav1217/can-someone-explain-this-kotlin-expression-59nn</link>
      <guid>https://forem.com/abhinav1217/can-someone-explain-this-kotlin-expression-59nn</guid>
      <description>&lt;p&gt;I am learning android development using kotlin. Being primarily a web developer, I am new to both technology.&lt;/p&gt;

&lt;p&gt;While looking for API-29 Connectivity Solution (&lt;code&gt;NetworkInfo&lt;/code&gt; and &lt;code&gt;getActiveNetworkInfo&lt;/code&gt; are deprecated in &lt;code&gt;API-29&lt;/code&gt;), I ran across this expression for variable declaration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight kotlin"&gt;&lt;code&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="py"&gt;callbackFunction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nc"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Unit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

 &lt;span class="k"&gt;abstract&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;startListening&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Unit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;How would I interpret this? Do I say, &lt;em&gt;&lt;code&gt;variable callbackFunction is of type Boolean, Or of type Unit&lt;/code&gt;&lt;/em&gt;. Or something else. In that abstract function, is callback type of Boolean or Unit or something else? &lt;/p&gt;

&lt;p&gt;Also I am a bit confused, about the curly braces. Does it mean variable is initialized by an empty anonyms function ( something like in javascript ) or is it something entirely different concept?&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>help</category>
      <category>explainlikeimfive</category>
    </item>
  </channel>
</rss>
