Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ri72miieop committed Nov 1, 2024
1 parent 5a4af3f commit 6c666c1
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions scripts/importFromFilesToDb.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { parse } from 'csv-parse'

import * as dotenv from 'dotenv'
dotenv.config({ path: '../.env' })
import { createReadStream } from 'fs'
import { finished } from 'stream/promises'

import {
InsertAccount,
InsertArchiveUpload,
Expand All @@ -22,7 +19,6 @@ import {

import {
createDbScriptClient,
createServerAdminClient,
} from '../src/utils/supabase'
import { Database } from '../src/database-types'

Expand All @@ -33,20 +29,7 @@ type Tables = Database['public']['Tables']
type TableNames = keyof Tables
type ColumnsFor<T extends TableNames> = keyof Tables[T]['Row']

enum FilesToProcess {
Account = 'account',
Profile = 'profile',
UserMentions = 'user_mentions',
Followers = 'followers',
Following = 'following',
Tweets = 'tweets',
TweetUrls = 'tweet_urls',
TweetMedia = 'tweet_media',
Likes = 'likes',
LikedTweets = 'liked_tweets',
MentionedUsers = 'mentioned_users',
ArchiveUpload = 'archive_upload',
}


function ifStringNullReturnNull(value: string | null): string | null {
return value === 'NULL' || !value ? null : value
Expand Down

0 comments on commit 6c666c1

Please sign in to comment.