'TypeError: to_sql() missing 1 required positional argument: 'con'

I have seen this question come up, but I thought I added a con into my code with sqlite3. What am I missing?

import pandas as pd
import sqlite3

conn = sqlite3.connect('test_database')
c = conn.cursor()

df = pd.DataFrame.to_sql('reddit_api', conn)

for post in res.json()['data']['children']:
    df = df.append({
        'subreddit': post['data']['subreddit'],
        'title': post['data']['title'],
        'selftext':post['data']['selftext'],
        'upvote_ratio': post['data']['upvote_ratio'],
        'ups':post['data']['ups'],
        'downs':post['data']['downs'],
        'score':post['data']['score']
    }, ignore_index=True)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source