Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blog/support-for-sqlite-extensions-added/ #11

Open
utterances-bot opened this issue May 25, 2023 · 2 comments
Open

blog/support-for-sqlite-extensions-added/ #11

utterances-bot opened this issue May 25, 2023 · 2 comments

Comments

@utterances-bot
Copy link

Support for SQLite extensions added - DB Browser for SQLite

https://sqlitebrowser.org/blog/support-for-sqlite-extensions-added/

@sqlitebrowser sqlitebrowser deleted a comment from Yuness3 Nov 14, 2023
@sqlitebrowser sqlitebrowser deleted a comment from Yukind-PRM Feb 1, 2024
@sqlitebrowser sqlitebrowser deleted a comment from JackyCafe Feb 1, 2024
Copy link

import sqlite3

Create a database in RAM

db = sqlite3.connect(':memory:')

Get a cursor object

cursor = db.cursor()
cursor.execute('''
CREATE TABLE Ages (
name VARCHAR(128),
age INTEGER
)''')

cursor.execute('''DELETE FROM Ages''')

Insert users

cursor.execute('''INSERT INTO Ages (name, age) VALUES ('Mara', 28)''')
cursor.execute('''INSERT INTO Ages (name, age) VALUES ('Otto', 33)''')
cursor.execute('''INSERT INTO Ages (name, age) VALUES ('Fyn', 31)''')
cursor.execute('''INSERT INTO Ages (name, age) VALUES ('Neshawn', 17)''')

#Select user
cursor.execute('''SELECT hex(name || age) AS X FROM Ages ORDER BY X''')

#retrieve the first row
user1 = cursor.fetchone()
#Print the first column retrieved(user's name)
print("The first row in the resulting record set : "+user1[0])

#Commit changes into database
db.commit()
#Close database
db.close()

@justinclift
Copy link
Member

@syedasaddev Um, what's that for? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants