↓ 跳过正文
Starmap & Dust

文章 · Posts

星图与尘埃的全部文章:技术实践、Hugo 建站、自媒体与生活成长。

129 篇文章 · 持续更新中

Sqlalchemy Stu

Sqlalchemy Stu

·391 字·1 分钟
https://docs.sqlalchemy.org/en/20/orm/quickstart.html https://docs.sqlalchemy.org/en/20/orm/basic_relationships.html#one-to-many https://docs.sqlalchemy.org/en/20/orm/queryguide/select.html 本身知识点 概念: 通过ORM(对象和表的映射)操作数据库的框架 步骤 创建基类 engine = create_engine(URL) Base = declarative_base(engine ) 定义映射 子类 表名 __tablename__ = '' 备注 __table_args__ = {'': ''} Column() 类型 db. Int float double String text longtext Date time datetime bool enum 参数 primary_key=True autoincrement=True default= doc= comment= 外键类 ForeignKey('表名.属性') ondelete='' CASCADE DELETE RESTRICT relationship('类名') 一对多 backref=True 一对一 子表 backref=backref('属性', uselist=False) 多对多 先用Table()设立中间表 backref=True, secondary=中间表变量名 表的操作 Base.metadata.drop_all() Base.metadata.create_all() CRUD session = sessionmaker(engine )() 增 子类对象 session = add(子类对象) 查 session.query(子类名).filter() first() 高级 session.query().order_by() all() 分页查询 方法1 session.query().slice() all() 方法2 session.query().offset().limit() all() session.commit() 其他 with_entities() 子类.sort.asc() alembic 数据库版本管理
操作系统大全

操作系统大全

·504 字·2 分钟
系统 # 虚拟系统 PVE!!!! pvesource ESXi 虚拟软件 virtualbox vmware 其他系统 win linux firPE UNRAID iKuai OpenWRT 系统安装 # u盘启动工具 # ETCHER ventoy!!!! , 开源 作用 为主机安装多系统 把多系统装进U盘 iso, img 固件引导方式和固件引导程序 # 计算机在加载操作系统之前,由底层固件(固件就是存储在主板上、在系统上电时最先运行的软件)来初始化硬件、检测系统状态和加载引导加载器的过程
Prompts

Prompts

·102 字·1 分钟
xxx领域有哪些重要概念? AA和BB, 有什么区别和联系? 设计一个公共布局组件. 定义网站整体布局 使用 Element Plus提供的响应式属性 用简单的方法实现 用户模块 即可, 但是这个方案要通用, 可扩展, 先梳理方案,随后写代码
Bible Words

Bible Words

·3081 字·7 分钟
Bible Words # word cloud # Numbers # The claim of the daughters of Zelophehad is legitimate. You must give them a grant of land along with their father’s relatives. Assign them the property that would have been given to their father.
Python Import

Python Import

·194 字·1 分钟
python 中的 import # 导包方式 # import xxx import xxx as xxx2 from xxx import func1, func2 from xxx import * 相对导入 绝对导入
Js Ts Base

Js Ts Base

·3033 字·7 分钟
应用场景 # 网页应用: 像 Notion、Trello 这种漂亮的 Web 工具。 浏览器插件: 比如给自己做一个“去广告”或者“网页翻译”的小插件,这非常有成就感。 跨平台 App: 用一套代码(如 React Native)同时做出 iOS 和安卓应用。 执行环境 # +---------------------------------------+ | JavaScript 代码 | +------------------+--------------------+ ↓ +---------------------------------------+ | V8 引擎 | | - 解析器 Parse | | - 字节码 Ignition | | - JIT 编译 TurboFan | | - 调用栈 Call Stack | | - 垃圾回收 GC | +------------------+--------------------+ ↓(触发异步) +---------------------------------------+ | 浏览器 Web APIs / Node.js libuv | | - setTimeout | | - fetch | | - 文件 IO | | - 网络 IO | +------------------+--------------------+ ↓(事件循环调度) +---------------------------------------+ | Event Loop | | - Microtasks(Promise…) | | - Macrotasks(Timeout…) | +---------------------------------------+ js # 书写: