FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
Tumitumie
Tumitumiewikiapptry
Public
Like
wikiapptry
Home
Code
3
backend
6
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
backend
/
database
/
README.md
Code
/
backend
/
database
/
README.md
Search
5/19/2025
README.md

Database Structure

This directory contains the database setup and query functions for the WhatsApp Wikipedia Bot.

Tables

Users Table (whatsapp_wiki_users_v1)

Stores information about users who have interacted with the bot.

ColumnTypeDescription
idINTEGERPrimary key
phone_numberTEXTUser's WhatsApp phone number (unique)
nameTEXTUser's name
preferred_content_typeTEXTUser's preferred content type (fact, audio, video)
last_interaction_timeINTEGERTimestamp of last interaction
created_atINTEGERTimestamp when user was created

Facts Table (whatsapp_wiki_facts_v1)

Stores fun facts that can be sent to users.

ColumnTypeDescription
idINTEGERPrimary key
topicTEXTTopic category of the fact
contentTEXTThe fact content
sourceTEXTSource of the fact
created_atINTEGERTimestamp when fact was added

Audio Table (whatsapp_wiki_audio_v1)

Stores audio clips that can be sent to users.

ColumnTypeDescription
idINTEGERPrimary key
titleTEXTTitle of the audio clip
descriptionTEXTDescription of the audio clip
urlTEXTURL to the audio file
topicTEXTTopic category of the audio
durationINTEGERDuration in seconds
created_atINTEGERTimestamp when audio was added

Video Table (whatsapp_wiki_video_v1)

Stores video clips that can be sent to users.

ColumnTypeDescription
idINTEGERPrimary key
titleTEXTTitle of the video clip
descriptionTEXTDescription of the video clip
urlTEXTURL to the video file
topicTEXTTopic category of the video
durationINTEGERDuration in seconds
created_atINTEGERTimestamp when video was added

Schema Changes

When changing the schema, create a new table with an incremented version number (e.g., whatsapp_wiki_users_v2) rather than altering the existing table.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.