我已经在 Windows 机器上安装了 python 3.5.3。我通过命令 sqlite3.sqlite_version 检查 SQLite 版本。它是版本3.8.11。
我的问题是如何将 SQLite 版本更新到 3.26?我不确定是否有第三方库或者我是否需要更新 sqlite3 库。
谢谢。
我目前正在尝试运行 run.rb 文件,但我不断收到 sqlite3 的错误。当我输入 时bundle install,我收到此成功消息:
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.5.3
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using bundler 2.0.1
Using coderay 1.1.2
Using equatable 0.5.0
Using method_source 0.9.2
Using mustermann 1.0.3
Using necromancer 0.4.0
Using tty-color 0.4.3
Using pastel 0.7.2
Using pry 0.12.2
Using rack 2.0.6
Using rack-protection 2.0.5
Using …Run Code Online (Sandbox Code Playgroud) 我无法概述与 .Net Core 和/或 Standard 一起使用的不同 SQLite 库。看来主要有两个:
MS 库完全独立于 sqlite.org 的库吗?如果是的话,建议使用哪一种?我更喜欢简单性......如果使用 sqlite.org,我似乎只需要两个 dll。
sqlite system.data.sqlite .net-core .net-standard .net-standard-2.0
在我的 Android 应用程序中,我创建了一个临时表来对其进行一些连接。
db.execSQL("CREATE TEMPORARY TABLE pair (a INTEGER, b INTEGER);")
Run Code Online (Sandbox Code Playgroud)
你能告诉我它的可用时间是多久吗?看来,如果我重新启动应用程序,它就会消失,但如果不重新启动,它似乎会在数据库中,但会持续多长时间?
我在文档中发现它是在临时数据库中创建的。
如果“CREATE”和“TABLE”之间出现“TEMP”或“TEMPORARY”关键字,则将在临时数据库中创建新表。
我正在编写一个烧瓶应用程序。我有两个文件。main.py 和databases.py。我想从database.py 文件创建一个数据库。main.py 应访问databases.py 文件并创建名为“Users”的数据库和表。但它显示导入错误。帮我解决这个问题
主要.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from databases import User
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/data_log.db'
db = SQLAlchemy(app)
if __name__ == '__main__':
db.create_all()
app.run(host='0.0.0.0', port=5001)
Run Code Online (Sandbox Code Playgroud)
数据库.py
from main import db
from passlib.apps import custom_app_context as pwd_context
class User(db.Model) :
__tablename__ = 'users'
user_id = db.Column(db.Integer, primary_key = True)
username = db.Column(db.String(32), index = True)
password = db.Column(db.String(128))
def hash_password(self, password) :
self.password =pwd_context.hash(password)
def verify_password(self, password) :
return pwd_context.verify(password, self.password)
Run Code Online (Sandbox Code Playgroud)
追溯: …
我想对保存在 SQLite 数据库中的日历条目进行排序,以便在列表视图中显示它们。如何使用 SQLite-net-plc 订购它们?
我以为我可以写:.OrderBy<CalendarEntryStartDate>但它不起作用,我尝试使用 SQLite 命令,但在使用它们时遇到了一些麻烦,因为我对 m.db 感到困惑。
using System;
using SQLite;
namespace Stundenplan.Models
{
public class CalendarEntry
{
[PrimaryKey, AutoIncrement]
public int CalendarEntryId { get; set; }
public string CalendarEntryTitle { get; set; }
public string CalendarEntryDescription { get; set; }
[Column("StatDate")]
public DateTime CalendarEntryStartDate { get; set; }
public DateTime CalendarEntryEndDate { get; set; }
public TimeSpan CalendarEntrySpan { get; set; }
public string CalendarEntryParticipants { get; set; }
public string CalendarEntrytLocation { get; …Run Code Online (Sandbox Code Playgroud) 我有一个用 Python 2.7 编写的项目,其中主程序需要频繁访问 sqlite3 数据库以写入日志、测量结果、获取设置等。
目前我有一个 db 模块,其中包含 add_log()、get_setting() 等函数,其中的每个函数基本上如下所示:
def add_log(logtext):
try:
db = sqlite3.connect(database_location)
except sqlite3.DatabaseError as e:
db.close() # try to gracefully close the db
return("ERROR (ADD_LOG): While opening db: {}".format(e))
try:
with db: # using context manager to automatically commit or roll back changes.
# when using the context manager, the execute function of the db should be used instead of the cursor
db.execute("insert into logs(level, source, log) values (?, ?, ?)", (level, source, logtext)) …Run Code Online (Sandbox Code Playgroud) 目前我正在开发一个Android应用程序,它存储用户的重要数据,例如密码,卡号,网站用户名和密码等。我决定使用SQLITE DB,以便用户的数据可以驻留在他们自己的手机中,并且我计划实施 AES-256 算法 (SQLCiper),以便使用密钥对数据进行加密。但我担心的是它能发挥多大作用,如果有人进行逆向工程或 root 会发生什么?
请帮助我弄清楚这一点。
提前致谢。
我正在构建一个简单的多活动列表应用程序来练习 SQLite。我试图从数据库中获取字符串以在listview启动时显示。我收到错误
\n\n\njava.lang.NullPointerException:尝试在空对象引用上调用虚拟方法 \'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()\'
\n
这是代码
\n\npublic class MainActivity extends AppCompatActivity {\n SharedPreferences sharedPreferences;\n ArrayList<String> listItem;\n ArrayAdapter adapter;\n ListView lv = (ListView) findViewById(R.id.list_view);\n DatabaseHelper db = new DatabaseHelper(this);\n Context context;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Toolbar toolbar = findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n listItem = new ArrayList<>();\n viewData();\n context = this;\n\n FloatingActionButton fab = findViewById(R.id.fab);\n fab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n startActivity(new Intent(MainActivity.this, textInput.class));\n }\n });\n }\n\n // cast from …Run Code Online (Sandbox Code Playgroud) 我正在使用 React Native 并正在查询 SQLite 数据库。
我希望执行类似的查询,并将搜索词指定为参数。
下面的内容与 ? 配合得很好 符号。
SELECT * from People WHERE Name = ?
Run Code Online (Sandbox Code Playgroud)
这不起作用或我尝试过的任何类似变体:
SELECT * from People WHERE Name LIKE '%?%'
Run Code Online (Sandbox Code Playgroud)
有人知道如何正确执行此操作吗?请不要对 SQL 注入提出任何插值或建议。
sqlite ×10
android ×3
python ×3
.net-core ×1
bundler ×1
c# ×1
database ×1
flask ×1
java ×1
javascript ×1
listview ×1
python-2.7 ×1
python-3.x ×1
react-native ×1
ruby ×1
rubygems ×1
sinatra ×1
sqlcipher ×1