aboutsummaryrefslogtreecommitdiff
path: root/parsecsv.go
diff options
context:
space:
mode:
authorleshe4ka46 <alex9102naid1@ya.ru>2025-10-08 13:39:23 +0300
committerleshe4ka46 <alex9102naid1@ya.ru>2025-10-08 13:39:23 +0300
commit31b2dce966be10902dd7f75a9e41dd3fd40e6680 (patch)
treec066921bf477477702a5011bfba58397c1b7b62d /parsecsv.go
parent6ca77396b806afd4f4adf59c0caee75e0ec2e7af (diff)
some initial dir structure and db thoughts
Diffstat (limited to 'parsecsv.go')
-rw-r--r--parsecsv.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/parsecsv.go b/parsecsv.go
deleted file mode 100644
index 65a4bd2..0000000
--- a/parsecsv.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package main
-
-import (
- "fmt"
- "time"
-
- "gorm.io/driver/postgres"
- "gorm.io/gorm"
-)
-
-type User struct {
- ID uint `gorm:"primaryKey"`
- Name string
- Age int
- Birthday time.Time
-}
-
-func (User) TableName() string {
- return "users"
-}
-
-type Model struct {
-}
-
-func main() {
- dsn := ""
- db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
-
- if err != nil {
- fmt.Println(err)
- return
- }
- if err := db.AutoMigrate(&User{}); err != nil {
- return
- }
- user := User{Name: "Jinzhu", Age: 18, Birthday: time.Now()}
-
- // Create a single record
-
- result := db.Create(&user) // pass pointer of data to Create
- fmt.Println(result.Error)
-
-}