Calendar Events Not Reaching Laravel Controller or Database

I’m trying to save events created in a Calendar to my database using Laravel. I have a route, controller, and AJAX request set up, but the event data doesn’t seem to be reaching the controller or getting saved in the database.

here is my code

my route 

Route::post('/save-calender-event-endpoint', [CalenderController::class, 'saveEvent']) -> name('save-calender-event-endpoint');
my controller

<?php

namespace AppHttpControllers;


use IlluminateHttpRequest;
use AppModelsCalenderEvent;

class CalenderController extends Controller
{
  public function saveEvent(Request $request) {

  print_r("hellow from calander controller");

    $request->validate([
        'event_name' => 'required|string|max:100',
        'Start_time' => 'required|date|before:End_time',
        'End_time' =>   'required|date|after:Start_time',
        'Category' => 'required|string|max:100',
        'event_postedby' => 'required|string|max:255',
       
    ]);

 try {
    $event = CalenderEvent::create([
        'event_name' => $request->event_name,
        'Start_time' => $request->Start_time,
        'End_time' => $request->End_time,
        'Category' => $request->Category,
        'event_postedby' => $request->event_postedby,
       
    ]);

    return response()->json(['success' => true, 'event' => $event],201);
} catch (Exception $e) {
  return response()->json(['success' => false, 'message' => 'Failed to save event.'], 500);
}
  }
}

Javascript 

function convertTo12HourFormat(time24) {
    // Assuming input is in HH:mm format, split the time into hours and minutes
    const [hours, minutes] = time24.split(':');

    // Create a new Date object based on the hours and minutes
    const date = new Date();
    date.setHours(hours);
    date.setMinutes(minutes);

    // Use toLocaleTimeString to convert the time to 12-hour format
    const options = { hour: '2-digit', minute: '2-digit', hour12: true };
    const time12 = date.toLocaleTimeString('en-US', options);

    return time12;
}


! function(e) {
    "use strict";
    var t = function() {
        this.$body = e("body"), this.$modal = e("#event-modal"), this.$event = "#external-events div.external-event", this.$calendar = e("#calendar"), this.$saveCategoryBtn = e(".save-category"), this.$categoryForm = e("#add-category form"), this.$extEvents = e("#external-events"), this.$calendarObj = null
    };
    t.prototype.onDrop = function(t, n) {
        var a = t.data("eventObject"),
            o = t.attr("data-class"),
            i = e.extend({}, a);
        i.start = n, o && (i.className = [o]), this.$calendar.fullCalendar("renderEvent", i, !0), e("#drop-remove").is(":checked") && t.remove()
    }, t.prototype.onEventClick = function(t, n, a) {
        var o = this,
            i = e("<form></form>");

        i.append("<label>Change event name</label>"),
        i.append("<div class='input-group'><input class='form-control' type=text value='" + t.title + "' /><span class='input-group-btn'><button type='submit' class='btn btn-success waves-effect waves-light'><i class='fa fa-check'></i> Save</button></span></div>"), 
      
        i.append("<label>Category</label>");
        i.append("<div class='form-group'><select class='form-control' name='category'></select></div>");
    
        // Populate the category dropdown
        var categorySelect = i.find("select[name='category']");
        categorySelect
            .append("<option value='bg-danger'>Red</option>")
            .append("<option value='bg-success'>Green</option>")
            .append("<option value='bg-dark'>Dark</option>")
            .append("<option value='bg-primary'>Blue</option>")
            .append("<option value='bg-pink'>Teal</option>")
            .append("<option value='bg-info'>Mint</option>")
            .append("<option value='bg-warning'>Yellow</option>");
    
        // Pre-select the event's category based on the event's className (category)
        categorySelect.val(t.className);  // Assuming className stores the category like bg-danger


    // Start time input (using a date-time picker or plain text input)
    i.append("<label>Start time</label>");
    i.append("<input type='text' class='form-control' value='" + moment(t.start).format('YYYY-MM-DD h:mm A') + "' />");
    
    // End time input (using a date-time picker or plain text input)
    i.append("<label>End time</label>");
    i.append("<input type='text' class='form-control' value='" + moment(t.end).format('YYYY-MM-DD h:mm A') + "' />");


        o.$modal.modal({
            backdrop: "static"
        }),
        
        o.$modal.find(".delete-event").show().end().find(".save-event").hide().end().find(".modal-body").empty().prepend(i).end().find(".delete-event").unbind("click").on("click", function() {
            o.$calendarObj.fullCalendar("removeEvents", function(e) {
                return e._id == t._id
            }), o.$modal.modal("hide")
        }), o.$modal.find("form").on("submit", function() {
            return t.title = i.find("input[type=text]").val(), o.$calendarObj.fullCalendar("updateEvent", t), o.$modal.modal("hide"), !1
        })
    }, t.prototype.onSelect = function(t, n, a) {
        var o = this;
        o.$modal.modal({
            backdrop: "static"
        });
        var i = e("<form></form>");
        i.append("<div class='row'></div>"),
        i.find(".row")
        .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Event Name</label><input class='form-control' placeholder='Insert Event Name' type='text' name='title'/></div></div>")
        .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Category</label><select class='form-control' name='category'></select></div></div>")
        .find("select[name='category']")
        .append("<option value='bg-danger'>Red</option>")
        .append("<option value='bg-success'>Green</option>")
        .append("<option value='bg-dark'>Dark</option>")
        .append("<option value='bg-primary'>Blue</option>")
        .append("<option value='bg-pink'>Teal</option>")
        .append("<option value='bg-info'>Mint</option>")
        .append("<option value='bg-warning'>Yellow</option></div></div>"), 
        
        i.find(".row")
        .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Start Time</label><input class='form-control' type='datetime-local' name='beginning'/></div></div>")
        .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>End Time</label><input class='form-control' type='datetime-local' name='ending'/></div></div>");
    
        
        
        o.$modal.find(".delete-event").hide().end()
                .find(".save-event").show().end()
                .find(".modal-body").empty().prepend(i).end()
                .find(".save-event").unbind("click").on("click", function() {
            i.submit()
        }), 
        
      /*  o.$modal.find("form").on("submit", function() {
            var e = i.find("input[name='title']").val(),
                a = (i.find("input[name='beginning']").val(),
                     i.find("input[name='ending']").val(), 
                     i.find("select[name='category'] option:checked").val()); */

             o.$modal.find("form").on("submit", function () {
            var e = i.find("input[name='title']").val(); // Event name
            var a = i.find("select[name='category'] option:checked").val(); // Category (color)
            var beginning = i.find("input[name='beginning']").val(); // Start time
            var ending = i.find("input[name='ending']").val(); // End time
           
        

            console.log('Start time:', beginning);  // Check the output here
            console.log('End time:', ending);      // Check the output here
            
            if (!beginning || !ending) {
                alert("Please select valid start and end times.");
                return false;
            }
        
            // Ensure the end time is after the start time
            if (new Date(ending) <= new Date(beginning)) {
                alert("End time must be after the start time.");
                return false;
            }

            //send data through AJAX

            
            
           // Save changes to event using AJAX
    o.$modal.find(".save-event").unbind("click").on("click", function() {
        // Gather event data
        var eventData = {
            event_name: i.find("input[name='title']").val(),
            category: i.find("select[name='category']").val(),
            start_time: moment(i.find("input[name='start_time']").val(), 'YYYY-MM-DD h:mm A').toISOString(),  // Convert to ISO string
            end_time: moment(i.find("input[name='end_time']").val(), 'YYYY-MM-DD h:mm A').toISOString(),  // Convert to ISO string
            event_postedby: "default_user" 
        };

        console.log("Save Event button clicked");
        // Display data in an alert (for testing purposes)
        alert("Hello, World! Data sent: nTitle: " + eventData.title + "nCategory: " + eventData.category);

        // Send the event data to the server via AJAX
        $.ajax({
            url: '/save-calender-event-endpoint',  
            type: 'POST',
            data: eventData,
            headers: {
                "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            },
            success: function(response) {
                if (response.success) {
                    // Event saved successfully
                    alert("Event saved successfully");
                } else {
                    alert("Error saving event: " + response.message);
                }
            },
            error: function(xhr, status, error) {
                alert("An error occurred while saving the event: " + error);
            }
        });
    });
            


              // Extract time (HH:mm) part from the full datetime string
    var startTime24 = beginning.split('T')[1].substring(0, 5); // Extract "HH:mm" from "YYYY-MM-DDTHH:mm"
    var endTime24 = ending.split('T')[1].substring(0, 5); // Extract "HH:mm" from "YYYY-MM-DDTHH:mm"

    // Convert the extracted 24-hour time to 12-hour format
    var startTime = convertTo12HourFormat(startTime24); // 12-hour format with AM/PM
    var endTime = convertTo12HourFormat(endTime24); // 12-hour format with AM/PM

    console.log('Formatted Start time:', startTime);
    console.log('Formatted End time:', endTime);

            return null !== e && 0 != e.length ? (o.$calendarObj.fullCalendar("renderEvent", {
                title: e,
                start: beginning,
                end: ending,
                allDay: false,
                className: a
            }, !0), o.$modal.modal("hide")) : alert("You have to give a title to your event"), !1
        }), o.$calendarObj.fullCalendar("unselect")
    }, t.prototype.enableDrag = function() {
        e(this.$event).each(function() {
            var t = {
                title: e.trim(e(this).text())
            };
            e(this).data("eventObject", t), e(this).draggable({
                zIndex: 999,
                revert: !0,
                revertDuration: 0
            })
        })
    }, t.prototype.init = function() {
        this.enableDrag();
        var t = new Date,
            n = (t.getDate(), t.getMonth(), t.getFullYear(), new Date(e.now())),
          
            o = this;
        o.$calendarObj = o.$calendar.fullCalendar({
            slotDuration: "00:15:00",
            minTime: "08:00:00",
            maxTime: "19:00:00",
            defaultView: "month",
            handleWindowResize: !0,
            height: e(window).height() - 100,
            header: {
                left: "prev,next today",
                center: "title",
                right: "month,agendaWeek,agendaDay"
            },
            events: [],
            editable: !0,
            droppable: !0,
            eventLimit: !0,
            selectable: !0,
            drop: function(t) {
                o.onDrop(e(this), t)
            },
            select: function(e, t, n) {
                o.onSelect(e, t, n)
            },
            eventClick: function(e, t, n) {
                o.onEventClick(e, t, n)
            }
        }), this.$saveCategoryBtn.on("click", function() {
            var e = o.$categoryForm.find("input[name='category-name']").val(),
                t = o.$categoryForm.find("select[name='category-color']").val();
            null !== e && 0 != e.length && (o.$extEvents.append('<div class="external-event bg-' + t + '" data-class="bg-' + t + '" style="position: relative;"><i class="fa fa-move"></i>' + e + "</div>"), o.enableDrag())
        })
    }, e.CalendarApp = new t, e.CalendarApp.Constructor = t
}(window.jQuery),
function(e) {
    "use strict";
    e.CalendarApp.init()
}(window.jQuery);
the html modal

   <div class="modal fade none-border" id="event-modal">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title"><strong>Add New Event</strong></h4>
                                </div>
                                <div class="modal-body"></div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Close</button>
                                    <button type="button" class="btn btn-success save-event waves-effect waves-light" >Create event</button>

                                    <button type="button" class="btn btn-danger delete-event waves-effect waves-light" data-dismiss="modal">Delete</button>
                                </div>
                            </div>
                        </div>
                    </div>

when i click create event i want it to create the event and store it in the database. I notice the print_r statement is not even being reached so I am unsure where i went wrong or what I overlooked . please help

Nopecha integration with playwrigth

Iam using playwright with nodejs and trying to solve the following captcha using nopecha without having to install the extension.
Captcha screenshot.
I installed Nopecha using Nodejs command “npm install nopecha” but the rest is a little bit confusing since I don’t even know what’s the type of that captcha.
Thanks,

How to add custom message on Zod tuple?

I want to return a custom message on a Zod tuple. I did not find any way to do that.

Returned message: Array must contain at least 4 element(s)

Code:

z.tuple([
    z.enum(),
    z.number(),
    z.string(),
    z.array(),
],
    { message: "Needs to be an array." })
    //.refine, .min, .length will not work here

What I tried

  • There are no .min, .length arguments to do a workarround
  • .refine will not be called — something else will call the message at first

How to pass a react component to a object property as value in TS

I have a routes.ts file. And I’m declaring my routes object as below –

type PublicRoute = {
    path: string,
    element: JSX.Element
}

const publicRoutes: Array<PublicRoute> = [
    {
        path: "/signup",
        element: <SignUp />
    }
]

But getting a compilation error as

Expected ">" but found "/"
  10 |      {
  11 |          path: "/signup",
  12 |          element: <SignUp /
     |                           ^
  13 |  ]

I want to use it through a .map function.

document.getElementById is not a function [closed]

I was watching a name input tutorial from Bro Code. However when I did the same as him, the browser says “document.getElementById is not a function”

I want a button that changes the label to certain text.

document.getElementsById("button").onclick = function buttonFunc() {
  username = document.getElementsById("sup").value;
  console.log(username);
  document.getElementsById("label").innerHTML = "Hello" + username;
}
```

<label id="label">Sup?</label>

<input type="text" id="sup">

<button type="button" id="button">Submit</button>

Handling events on Metronic Tailwind CSS components in Blazor

I am attempting to use Metronic (9.x) with Blazor, and have started a project based on the official sample found here: https://github.com/keenthemes/metronic-tailwind-html-integration/tree/638f04486f737a6c5b86edf51666b8eb72469fb8/metronic-tailwind-blazor-server

Although I have to point out, this hardly qualifies as a “Blazor” sample since it is really just html, served up with Blazor. That is exactly the problem though, since I cannot figure out how to do something as simple as create a dropdown with clickable items that can be captured with @onchange or @onclick events.

For example, if I look at the official Metronic Tailwind CSS docs for Dropdown (https://keenthemes.com/metronic/tailwind/docs/components/dropdown) and Menu (https://keenthemes.com/metronic/tailwind/docs/components/menu/) then I was hoping to be able to do something like this:

@page "/stacks"

<PageTitle>MyPage</PageTitle>

<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
    <button class="dropdown-toggle btn btn-light">
        Show Dropdown
    </button>
    <div class="dropdown-content w-full max-w-56 py-2">
        <div class="menu menu-default flex flex-col w-full">
        @foreach (var myItem in allItems)
        {
            <div class="menu-item">
                <a class="menu-link" @onclick="HandleMyClickEvent">
                    <span class="menu-icon">
                        <i class="ki-outline ki-badge">
                        </i>
                    </span>
                    <span class="menu-title">
                        Menu item @myItem.Name
                    </span>
                </a>
            </div>
        }
        </div>
    </div>
</div>

@code {
    private List<MyClass> allItems = new();

    public class MyClass
    {
        public Guid Id { get; set; }
        public string Name { get; set; }

    }

    protected override async Task OnInitializedAsync()
    {
        allItems = new List<MyClass>()
        {
            new MyClass()
            {
                Id = Guid.NewGuid(),
                Name = "foo",
            },
            new MyClass()
            {
                Id = Guid.NewGuid(),
                Name = "bar",
            }
        };

    }
    
    private async Task HandleMyClickEvent(MouseEventArgs e)
    {
        Console.WriteLine("Event has been triggered!");
    }    

}

However, the @onclick delegation does not trigger. In fact it doesn’t look like any of the built-in Blazor delegators (such as @onchange etc.) can be triggered anywhere, so I assume that I am supposed to somehow tap into the built-in metronic events. (see https://keenthemes.com/metronic/tailwind/docs/components/menu#events).

How am I supposed to set this up?

Replace default mouse cursor in Gmail and Chromium

I am trying to replace the default (ugly) mouse cursors that Gmail uses within Chromium. This problem does not happen in Firefox.

So far, I have the following code…

  1. I detect the custom icon
  2. I replace that icon by local one by appending a property to head

This does seem to work, but the default icon still appears, as it first needs to be detected.

Is there a better approach to accomplish my goal?

let custom_cursor_a = 'url("https://ssl.gstatic.com/ui/v1/icons/mail/images/2/openhand.cur") 7 5, default';
let custom_cursor_b = 'url("https://ssl.gstatic.com/ui/v1/icons/mail/images/2/closedhand.cur") 7 5, move';
document.addEventListener('mouseover',function(e){
  var cursor = getComputedStyle(e.target).cursor;
  //console.log(cursor);
  const cursorStyle = document.createElement('style');
  cursorStyle.id = 'cursor-style';
  if (cursor == custom_cursor_a) {
    console.log("custom_cursor_a");
    cursorStyle.innerHTML = '* {cursor: -webkit-grab !important; cursor: -moz-grab !important; cursor: -o-grab !important; cursor: -ms-grab !important; cursor: grab !important}';
    document.head.appendChild(cursorStyle);
  } else {
    if (cursor == custom_cursor_b) {
      console.log("custom_cursor_b");
      cursorStyle.innerHTML = '* {cursor: -webkit-grabbing !important; cursor: -moz-grabbing !important; cursor: -o-grabbing !important; cursor: -ms-grabbing !important; cursor: grabbing !important;}';
      document.head.appendChild(cursorStyle);
    } else {
      console.log(cursor);
      if (document.getElementById('cursor-style')) { document.getElementById('cursor-style').remove(); }
    }
  }
});

How could I obtain clickable box ability for every box I have newly created for creating new boxes at the end of boxes row

I want to change my code for obtaining creation of new round box after clicking any box from new created set of them, not only first box. How could I obtain this ability for my code?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="boxfull.css">
    <title>Document</title>
</head>
<body>
<style>
    body{
    background-color:black;
}
    .box{
    width:100px;
    height:100px;
    background-image: linear-gradient(45deg, red, yellow);
    border-radius:40px;
    transition: box-shadow 0.5s ease;
    display:inline-block;
    user-select:none;
}
.box:hover{
    box-shadow:inset 0px 0px 10px 8px rgba(55, 155, 50), inset 0px 0px 10px 16px rgba(55, 155, 255), inset 0px 0px 10px 24px rgba(155, 55, 255);
    transition: box-shadow 0.5s ease;
}
</style>
    <div class="box"></div>
    <script>
const box = document.querySelector('.box')
box.addEventListener('click', () => {
    const setbox = document.createElement('div')
    document.body.appendChild(setbox).classList.add('box')
})
</script>
</body>
</html>

Formating the date with bootstrap datepicker

I have an input where using bootstrap datepicker, but i want the output format to be like (Day – Month #, year)
ex: Wednesday – January 1, 2025.

<div class="col-md-6">
 <div class="form-group">
  <label>Date</label>
  <div class="date input-group">
   <input
    type="text"
    class="datepicker form-control"
    id="date-input"
   />
  </div>
 </div>
</div>

here is my script for updating the input value

$(document).ready(function () {
                $("#date-input").datepicker({
                    format: "mm/dd/yyyy", 
                    autoclose: true,
                });

                $(".datepicker").on("changeDate", function (e) {
                    const selectedDate = e.date; // Get selected date as JavaScript Date object
                    const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" };
                    const formattedDate = selectedDate.toLocaleDateString("en-US", options);

$("#date-input").datepicker("update", formattedDate); 
                });
            });

but it does not update the input value. but it shows a correct output on my console.log

change input value on change

I have an input where using bootstrap datepicker, but i want the output format to be like (Day – Month #, year)
ex: Wednesday – January 1, 2025.

<div class="col-md-6">
 <div class="form-group">
  <label>Date</label>
  <div class="date input-group">
   <input
    type="text"
    class="datepicker form-control"
    id="date-input"
   />
  </div>
 </div>
</div>

here is my script for updating the input value

$(document).ready(function () {
                $("#date-input").datepicker({
                    format: "mm/dd/yyyy", 
                    autoclose: true,
                });

                $(".datepicker").on("changeDate", function (e) {
                    const selectedDate = e.date; // Get selected date as JavaScript Date object
                    const options = { weekday: "long", year: "numeric", month: "long", day: "numeric" };
                    const formattedDate = selectedDate.toLocaleDateString("en-US", options);

$("#date-input").datepicker("update", formattedDate); 
                });
            });

but it does not update the input value. but it shows a correct output on my console.log

Chrome Extension Error Content Security Policy

I am receiving 2 errors in console regarding my chrome extension for an image that follows the cursor around.

This is my manifest.json:

{
  "name": "Custom Cursor Extension",
  "version": "1.0",
  "manifest_version": 3,
  "description": "Adds a custom cursor on developer.chrome.com.",
  "permissions": ["activeTab", "scripting"],
  "background": {
    "service_worker": "/background.js"
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["content.js"],
      "css": ["style.css"]
    }
  ],
  "action": {
    "default_popup": "popup.html",
    "default_icon": "image.png"
  },

   "content_security_policy": {
    "script-src": ["'self'", "https://www.gstatic.com", "'unsafe-eval'"], 
    "object-src": ["'self'"],
    "img-src": ["'self'", "data:", "https://www.gstatic.com"]
   }
}

Console Error messages

Image not loading

Hide the data array from php in javascript [closed]

The problem – hide the data received from php array in a web-page and passed on to a hidden JavaScript.

Current html and JavaScript

<?php
  define('MyConst', TRUE);
  require_once( "/home/xxxxx/constants.php");

  // Create connection
  $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  $query = "SELECT `field1`, `field2` FROM `datarecords`";
  $stmt = $conn->prepare($query);
  $stmt->execute();
  $stmt->bind_result($field1, $field2);
  $resultdata = array();
  while($stmt->fetch()){
    $toto  = array();
    $toto['field1'] = $field1;
    $toto['field2'] = $field2;
    array_push($resultdata, $toto);
  }
  //print "<pre>";print_r($resultdata);print "</pre>";

 //CLOSE the connection
 $conn->close();
?>

<!DOCTYPE html>
<html>
<head>
<style>
  css code
</style>
</head>
<script>
  function execJS(){
    var jPass = <?php echo json_encode($resultdata); ?>;
    showStatus(jPass);
  }
</script>
<script type="text/javascript" src="script/js.js" language="javascript">
</script>

<body onload="execJS()">
<table id="stylewithcss">

</table>
    
</body>
</html>

When the page is loaded, the javascript gets executed in the order (this method helped me to hide the js.js) –> execJS() and then js.js and all expected results are shown. However on inspect (in Firefox browser), the data inside the ‘$resultdata’ is shown. Would like to hide this data. Any help / suggestion is appreciated.

TypeError: client.query is not a function

enter image description here

enter image description here

Hi I was trying to do a next js project and i got this error while trying to connect database.
I am using neon database.

app/provider.js

"use client";
import React, { useEffect } from "react";
import { useUser } from "@clerk/nextjs";
import { db } from "@/configs/db"; 
import { eq } from "drizzle-orm";
import { Users } from "@/configs/schema";

function Provider({ children }) {
  const { user } = useUser();

  const isNewUser = async () => {
    try {
      const result = await db
        .select()
        .from(Users)
        .where(eq(Users.email, user?.primaryEmailAddress?.emailAddress));

      console.log(result);

      if (!result.length) {
        await db.insert(Users).values({
          name: user?.fullName,
          email: user?.primaryEmailAddress?.emailAddress,
          imageUrl: user?.profileImageUrl,
        });
        console.log("New user added to the database.");
      }
    } catch (error) {
      console.error("Error during user validation or insertion:", error);
    }
  };

  useEffect(() => {
    if (user) {
      isNewUser();
    }
  }, [user]);

  return <div>{children}</div>;
}

export default Provider;

configs/db.js

import { neon } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-serverless';

const sql = neon(process.env.NEXT_PUBLIC_DATABASE_URL);
export const db = drizzle(sql);

configs/schema.js

import { boolean, pgTable, serial, varchar } from "drizzle-orm/pg-core";

export const Users = pgTable('users',{
    id:serial('id').primaryKey(),
    name:varchar('name').notNull(),
    email:varchar('email').notNull(),
    imageUrl:varchar('imageUrl'),
    subscription:boolean('subscription').default(false)
})

I tried making db.js into async function based on some related answers it but still i am getting same error. Thanks in advance