並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 31 件 / 31件

新着順 人気順

create table in database sqlite pythonの検索結果1 - 31 件 / 31件

  • 「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる

    はじめに 「Just use Postgres」という言葉を初めて聞いたのは、いつだったか覚えていません。Twitter か Hacker News か、あるいは社内の Slack か。どこで聞いたにせよ、私の反応は決まっていました。「また極端なことを言う人がいる」と。 「それ、〇〇でもできますよ」——この手のフレーズはもう100回は聞いてきました。そして大抵の場合、その〇〇は専用ツールに置き換えられていきます。技術が専門分化していくのは自然な流れです。 全文検索なら Elasticsearch。時系列データなら InfluxDB。メッセージキューなら RabbitMQ。それぞれの分野に専門家がいて、専用のソリューションがあって、ベストプラクティスがあります。「とりあえず Postgres で」なんて、それは思考停止ではないか、と。でも、心のどこかで気になっていたんです。 www.mann

      「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる
    • 【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい

      はじめに 対象イベント 読み方、使い方 Remote Code Execution(RCE) 親ディレクトリ指定によるopen_basedirのバイパス PHP-FPMのTCPソケット接続によるopen_basedirとdisable_functionsのバイパス JavaのRuntime.execでシェルを実行 Cross-Site Scripting(XSS) nginx環境でHTTPステータスコードが操作できる場合にCSPヘッダーを無効化 GoogleのClosureLibraryサニタイザーのXSS脆弱性 WebのProxy機能を介したService Workerの登録 括弧を使わないXSS /記号を使用せずに遷移先URLを指定 SOME(Same Origin Method Execution)を利用してdocument.writeを順次実行 SQL Injection MySQ

        【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
      • 🦆🦆🦆🦆🦆🦆DuckDB入門🦆🦆🦆🦆🦆🦆

        tl;dr SQLiteのOLAP版だよ OLAP系のクエリにおいて、PandasやSQLiteより早いらしいよ CSV・Parquet・Pandas DataFrameの読み書きできて便利だよ 背景 ポジション・競合 一言で言うとSQLiteのOLAP版です。位置づけとしては、論文(DuckDB: an Embeddable Analytical Database (SIGMOD 2019 Demo))記載のSystem Landscapeがわかりやすいです。 (DuckDB: an Embeddable Analytical Database (SIGMOD 2019 Demo)より) このLandscapeでは、データベースを Standalone(クライアント・サーバモデル)か、組み込み(シングルマシン・インプロセス)か OLTPかOLAPか の二軸に分割しています。その上で、 ク

          🦆🦆🦆🦆🦆🦆DuckDB入門🦆🦆🦆🦆🦆🦆
        • GitHub - modelcontextprotocol/servers: Model Context Protocol Servers

          Official integrations are maintained by companies building production ready MCP servers for their platforms. 21st.dev Magic - Create crafted UI components inspired by the best 21st.dev design engineers. ActionKit by Paragon - Connect to 130+ SaaS integrations (e.g. Slack, Salesforce, Gmail) with Paragon’s ActionKit API. Adfin - The only platform you need to get paid - all payments in one place, in

            GitHub - modelcontextprotocol/servers: Model Context Protocol Servers
          • Joining CSV and JSON data with an in-memory SQLite database

            19th June 2021 The new sqlite-utils memory command can import CSV and JSON data directly into an in-memory SQLite database, combine and query it using SQL and output the results as CSV, JSON or various other formats of plain text tables. sqlite-utils memory The new feature is part of sqlite-utils 3.10, which I released this morning. You can install it using brew install sqlite-utils or pip install

              Joining CSV and JSON data with an in-memory SQLite database
            • しくじり先生のように学ぶ「NFS+sqliteで苦労した話から学ぶ、問題解決の考え方」という勉強会をやってみました | Raccoon Tech Blog [株式会社ラクーンホールディングス 技術戦略部ブログ]

              株式会社ラクーンホールディングスのエンジニア/デザイナーから技術情報をはじめ、世の中のためになることや社内のことなどを発信してます。 インフラLinux勉強会SQLiteNFS こんにちは、羽山です。 今回は社内で実施した勉強会をほぼそのままブログ記事にしています。 ITエンジニアたるものドキュメントを残したり勉強会を実施したり分かりやすい設計にリファクタリングしたりなど、日々 知見の伝達 を意識していると思います。主要な知見はたいていそれらの方法で満たせるのですが、しかし残念ながら中には画一的な方法では伝えにくいものもあったりします。 ところで伝統芸能や工芸の世界では技術の継承において 背中を見て学ぶ という方法が用いられることがあるようです。 これと似た手法はITエンジニアの世界にもあって、先輩エンジニアとペアプログラミングをすることで文書では伝わりにくい技術や考え方・テクニックを学ぶ

                しくじり先生のように学ぶ「NFS+sqliteで苦労した話から学ぶ、問題解決の考え方」という勉強会をやってみました | Raccoon Tech Blog [株式会社ラクーンホールディングス 技術戦略部ブログ]
              • Parsing SQL - Strumenta

                The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                  Parsing SQL - Strumenta
                • Claude Codeにセキュリティ診断をさせてみた

                  はじめに こんにちは、Claude Codeを使っていますか? 私の観測範囲内でもClaude Codeを使っている人がどんどん増えてきています。 他のAIコーディングエージェントから乗り換えている人も結構な人数いそうです。 今回の記事ではClaude Codeに脆弱性の診断をさせてみました。 診断の対象としたのは以前の記事でClaude Codeに作ってもらった以下のAIチャットボットのアプリケーションです。 リポジトリはこちら 記事はこちら 実践 診断開始 今回はClaude Codeで以下のようなプロンプトで指示を出しました。 > あなたは経験豊富なセキュリティ専門家(ホワイトハッカー)として行動してください。 **要求する分析内容:** 1. **脆弱性の特定** - 発見した脆弱性の種類と場所を明確に指摘 - 各脆弱性のCVE分類またはOWASP Top 10での位置づけ 2.

                    Claude Codeにセキュリティ診断をさせてみた
                  • #!/usr/bin/env docker run

                    Dockerfile `�3 �� � � �� #!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" # syntax = docker/dockerfile:1.4.0 FROM node:20 WORKDIR /root RUN npm install sqlite3 RUN <<EOF cat >/root/schema.sql CREATE TABLE IF NOT EXISTS clicks ( id INTEGER PRIMARY KEY AUTOINCREMENT, time INTEGER NOT NULL ); E

                      #!/usr/bin/env docker run
                    • Cloudflare WorkersでサーバーレスPythonアプリを構築してみよう | gihyo.jp

                      筒井(@ryu22e)です。2024年7月の「Python Monthly Topics」は、Cloudflare WorkersのPythonサポートについて解説します。 前半ではCloudflare WorkersでPythonを使う方法について、後半ではCloudflare WorkersでPythonを動かす仕組みと技術的制限について解説します。 なお、Cloudflare WorkersのPythonサポートは本記事執筆時点(2024年7月24日)でオープンベータ版です。正式リリース時には仕様が変更される可能性があります。また、一部機能はローカル環境でしか利用できません。 Cloudflare Workersとは Cloudflare Workersは、Cloudflareが提供するサーバーレスアプリケーションを構築・デプロイするためのプラットフォームです。主に以下のような特徴が

                        Cloudflare WorkersでサーバーレスPythonアプリを構築してみよう | gihyo.jp
                      • Fine-tuning GPT-3.5-Turbo for Natural Language to SQL

                        Photo by Mariia Shalabaieva on UnsplashBackgroundAllowing non-technical users to ask questions from a database has been a problem of interest in academia and industry for years. The recent advances in Large Language Model (LLM) technology, such as GPT-4, have improved the accuracy of proposed solutions. However, since the most advanced LLMs have not been open for fine-tuning, recent work in the sp

                          Fine-tuning GPT-3.5-Turbo for Natural Language to SQL
                        • FastAPI SQLModel 入門 - Qiita

                          SQLModel はPythonコードから SQL databases と会話するためのライブラリです。ここでは FastAPI での使われ方を見ていきますが、FastAPIとは独立したものとして設計されています。 SQLModelはFastAPI の作者が自ら作成しており、SQLAlchemy と Pydantic の両方との互換性を保っています。Pydantic はデータ検証のためのPythonライブラリです。Pythonのtype hintが使われます。ですからPydanticクラスはAPIの入り口であるパスオペレーション関数で使われることが一般的です。 過去記事「FastAPI と SQL Databases(SQLAlchemy)」でFastAPIで SQLAlchemy を使ってSQL Databaseを扱う方法を述べましたが、SQLAlchemy と Pydantic の2重

                            FastAPI SQLModel 入門 - Qiita
                          • Blog

                            Hachi: An (Image) Search engine Only the dead have seen the end of war .. George Santayana For quite some time now, i have been working on and off on a fully self-hosted search engine, in hope to make it easier to search across Personal data in an end to end manner. Even as individuals, we are hoarding and generating more and more data with no end in sight. Such "personal" data is being stored fro

                            • BigQueryを補完する技術: DuckDBとDataflowでのデータ処理入門 - yasuhisa's blog

                              背景 & Disclaimer DuckDB 概念や代表的なユースケース 使ってみる 1週間〜一ヶ月などある程度の期間、分析で使いたい場合 便利なCLIツールとして使う 所感 参考 Dataflow 代表的なユースケース 具体例 参考 背景 & Disclaimer BigQueryは非常に便利で、BigQueryにさえ上がってしまえばSQLで巨大なデータを簡単に相手にできます とはいえ、BigQueryに行きつくまでが大変な場合もありえます 例: 個人情報を含むsensitiveなデータで、BigQueryに気軽に上げられないケース 一時的であっても、相談なしにその手のデータを気軽にアップロードするのはやめてください... 数万件程度であれば手元のエクセルで開いて、問題ない行/列だけに絞る、ということもできるが、もっと量が多いデータだとそういうわけにもいかない。そもそも分析はSQLでやり

                                BigQueryを補完する技術: DuckDBとDataflowでのデータ処理入門 - yasuhisa's blog
                              • 最近話題のVector Searchを実現するFaissって何? #1|masuidrive

                                Faissを使ったFAQ検索システムの構築Facebookが開発した効率的な近似最近傍検索ライブラリFaissを使用することで、FAQ検索システムを構築することができます。 まずは、SQLiteデータベースを準備し、FAQの本文とそのIDを保存します。次に、sentence-transformersを使用して各FAQの本文の埋め込みベクトルを計算し、そのベクトルをFaissインデックスに追加します。新しいクエリが入力されたときは、sentence-transformersを使用してクエリの埋め込みベクトルを計算し、Faissインデックスを使用して、クエリの埋め込みベクトルに最も類似したFAQの埋め込みベクトルを検索します。 検索結果は、FAQのIDのリストとして返され、最後に返されたIDを使用して、SQLiteデータベースから関連するFAQの本文を取得し、検索結果としてユーザーに表示されま

                                  最近話題のVector Searchを実現するFaissって何? #1|masuidrive
                                • 【Python】SQLite で日本語を全文検索するコード例【N-Gram, FTS4/FTS5】

                                  日本語の全文検索ぜんぶんけんさく (full-text search, FTS) を、高速に実行する Python コード例です。 Python の標準モジュール sqlite3 を使用しました。 sqlite3 から、SQLiteエスキューライト の全文検索 (FTSエフティーエス) を使ってみました。 試したのは、FTS4エフティーエスフォー と FTS5エフティーエスファイブ の2種類です。 ところで、SQLite の読み方は色々ありました。YouTube では、エスキューライト、エスキューエライト、スィクライト、スィクエライト、などの発音を聞きました。 全文検索の使い方(FTS の使い方)ですが、テキストを N-Gram にして、FTS4 か FTS5 の仮想テーブルに INSERT するだけでした。 (2022年2月5日 追記)MeCab の使い方も書きました。 MeCab で

                                    【Python】SQLite で日本語を全文検索するコード例【N-Gram, FTS4/FTS5】
                                  • Supercharge SQLite with Ruby Functions

                                    An interesting twist in my recent usage of SQLite was the fact that I noticed my research scripts and the database intertwine more. SQLite is unique in that it really lives in-process, unlike standalone database servers. There is a feature to that which does not get used very frequently, but can be indispensable in some situations. By the way, the talk about the system that made me me to explore S

                                    • Towards Inserting One Billion Rows in SQLite Under A Minute - blag

                                      Current Best: 100M rows inserts in 33 seconds. (you can check the source code on Github) Recently, I ran into a situation where I needed a test database with lots of rows and needed it fast. So I did what any programmer would do: wrote a Python script to generate the DB. Unfortunately, it was slow. Really slow. So I did what any programmer would do: went down the rabbit hole of learning more about

                                      • Handling Concurrency Without Locks

                                        Concurrency is not very intuitive. You need to train your brain to consider what happens when multiple processes execute a certain code block at the same time. There are several issues I often encounter: Failing to recognize potential concurrency issues: It's not uncommon for both beginner and seasoned developers to completely miss a potential concurrency problem. When this happens, and the concur

                                        • 週刊Railsウォッチ: DI的な書き方が必要なとき、脆弱性学習用アプリRailsGoat、brakemanは優秀ほか(20210705前編)|TechRacho by BPS株式会社

                                          週刊Railsウォッチについて 各記事冒頭には🔗でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 お気づきの点がありましたら@hachi8833までメンションをいただければ確認・対応いたします🙇 TechRachoではRubyやRailsなどの最新情報記事を平日に公開しています。TechRacho記事をいち早くお読みになりたい方はTwitterにて@techrachoのフォローをお願いします。また、タグやカテゴリごとにRSSフィードを購読することもできます(例:週刊Railsウォッチタグ) 🔗Rails: 先週の改修(Rails公式ニュースより) 今回も以下の公式更新情報の続きを追います。次の更新情報も出ましたね。 更新情報: Rails 6.

                                            週刊Railsウォッチ: DI的な書き方が必要なとき、脆弱性学習用アプリRailsGoat、brakemanは優秀ほか(20210705前編)|TechRacho by BPS株式会社
                                          • LLMs and SQL

                                            Francisco Ingham and Jon Luo are two of the community members leading the change on the SQL integrations. We’re really excited to write this blog post with them going over all the tips and tricks they’ve learned doing so. We’re even more excited to announce that we’ll be doing an hour long webinar with them to discuss these learnings and field other related questions. This webinar will be on March

                                              LLMs and SQL
                                            • StreamlitでEDINETから有価証券報告書をダウンロードして分析するWEBアプリをサクっとつくろう

                                              参考文献 ※1 EDINET API機能追加に係る利用者向け説明会資料 ※2 EDINET API仕様書 Version2 ①会社名の選択 まず会社一覧及び、会社のEDINETコードが必要になってきます。 これについてはAPIで取得する方法はなく公式サイトからZIPを落としてくるか ここからプログラム的に自動でダウンロードする必要があります。 今回は手動であらかじめダウンロードしたものを使います。 公式サイトからダウンロードすると毎回リンクが変わる、上記の直接リンクだと固定という謎仕様のようです(ドキュメントにもそうかいてある) ZIPを展開するとShift-JISのCSVが手に入ります。文字コードに注意しましょう。EDINETからダウンロードするCSVはUTF16なのにこっちはShiftJISなのです。 中身は上記のようなもになっています。 末尾に0がついているものの証券コードも入ってい

                                                StreamlitでEDINETから有価証券報告書をダウンロードして分析するWEBアプリをサクっとつくろう
                                              • Bashing JSON into Shape with SQLite

                                                Published on 2022-01-04, 1640 words, 6 minutes to read It is clear that most of the world has decided that they want to use JSON for their public-facing API endpoints. However, most of the time you will need to deal with storage engines that don't deal with JSON very well. This can be confusing to deal with because you need to fit a square peg into a round hole. However, SQLite added JSON function

                                                • Introducing Apache Arrow Flight SQL: Accelerating Database Access

                                                  Introducing Apache Arrow Flight SQL: Accelerating Database Access Published 16 Feb 2022 By José Almeida, James Duong, Vinicius Fraga, Juscelino Junior, David Li, Kyle Porter, Rafael Telles We would like to introduce Flight SQL, a new client-server protocol developed by the Apache Arrow community for interacting with SQL databases that makes use of the Arrow in-memory columnar format and the Flight

                                                    Introducing Apache Arrow Flight SQL: Accelerating Database Access
                                                  • S3 is files, but not a filesystem

                                                    S3 is files, but not a filesystem March 2024 "Deep" modules, mismatched interfaces - and why SAP is so painful My very own "object store" Amazon S3 is the original cloud technology: it came out in 2006. "Objects" were popular at the time and S3 was labelled an "object store", but everyone really knows that S3 is for files. S3 is a cloud filesystem, not an object-whatever. I think the idea that S3

                                                      S3 is files, but not a filesystem
                                                    • Cross-database queries in SQLite (and weeknotes)

                                                      21st February 2021 I released Datasette 0.55 and sqlite-utils 3.6 this week with a common theme across both releases: supporting cross-database joins. Cross-database queries in Datasette SQLite databases are single files on disk. I really love this characteristic—it makes them easy to create, copy and move around. All you need is a disk volume and you can create as many SQLite databases as you lik

                                                        Cross-database queries in SQLite (and weeknotes)
                                                      • PythonとSQLの連携: データベース操作の新しい次元 - Python転職初心者向けエンジニアリングブログ

                                                        **** SQL(Structured Query Language)はデータベース管理システムで広く使用される言語であり、Pythonとの連携により柔軟で効率的なデータベース操作が可能です。今回は、PythonからSQLを利用してデータベースに接続し、クエリを実行する手法について具体的なコードとともに解説します。 1. PythonからSQLiteデータベースに接続する 最初に、PythonからSQLiteデータベースに接続する例を見てみましょう。SQLiteは軽量でシンプルなデータベースエンジンであり、Python標準ライブラリにも含まれています。 Pythonのコード import sqlite3 # SQLiteデータベースに接続 conn = sqlite3.connect('sample.db') # カーソルを取得 cursor = conn.cursor() # データベー

                                                          PythonとSQLの連携: データベース操作の新しい次元 - Python転職初心者向けエンジニアリングブログ
                                                        • Django: what’s new in 6.0 - Adam Johnson

                                                          Django 6.0 was released today, starting another release cycle for the loved and long-lived Python web framework (now 20 years old!). It comes with a mosaic of new features, contributed to by many, some of which I am happy to have helped with. Below is my pick of highlights from the release notes. Upgrade with help from django-upgrade If you’re upgrading a project from Django 5.2 or earlier, please

                                                          • Python+Peewee ORM+SQLiteで1億レコード最速insertチャレンジ | さかな前線

                                                            イワシの大群が特に大規模になったとき、それをサーディンランと呼び、個体数は数千万とも数億とも数十億ともいわれるのだそうです。そのような生物量がそれほど密集したとき酸素濃度は足りるんだろうかと心配です。 さて、データ処理の一環で億オーダーのレコード数(ディスク上で~100GB)をもつSQLiteテーブルを構築しようということになり、データ自体は生CSVがある状態でこれをなるべく短時間でDBに流し込むという雑なチャレンジをしてみたので、雑な記録をまとめておきました。 できるだけPythonで閉じさせたかったため、C++などで書くという選択肢はなし。 またDBサイズがサイズなのでインメモリではなくファイルに吐き出します。 またスキーマ定義をさくっとやりたい・DB構築後の扱いを楽にしたいということで、PythonベースのORM Peeweeを使用することにしています。なおPeeweeについて詳細は

                                                            • Building the Same App Using Various Web Frameworks

                                                              Building the Same App Using Various Web Frameworks [ learning engineering python 🛠 ] · 8 min read Recently, I’ve been wondering if I should migrate from my current web app stack (FastAPI, HTML, CSS, and a sprinkle of JavaScript) to a modern web framework. I was particularly interested in FastHTML, Next.js, and Svelte. FastHTML: Many folks have started building with it since Jeremy Howard launched

                                                                Building the Same App Using Various Web Frameworks
                                                              • FastAPIを支えるデータ検証ライブラリ「Pydantic」のV2がベータリリースされたので使ってみた

                                                                はじめに こんにちは。Acompanyの田中(@tkrk_p)です。本記事はAcompany5周年アドベントカレンダー19日目の記事となります。 1日前の記事はこちら↓ 本記事では、先日ベータリリースされたデータ検証ライブラリ「Pydantic」のV2を紹介します。 Pydanticとは Samuel Colvin氏によって2017年に開発されたPythonのデータパース・変換ライブラリです。Pythonの型アノテーションを使用してデータモデルを定義し、入力データの検証や型変換、データのシリアライズ(シリアル化)およびデシリアライズ(逆シリアル化)などの便利な機能を提供しています。 2023年6月現在で月間 7,000 万件以上ダウンロードされていることから、ここ数年で非常に注目されていることがわかります。(ちなみにDjangoのダウンロード数は月間約950万件) PyPIでのDjango

                                                                  FastAPIを支えるデータ検証ライブラリ「Pydantic」のV2がベータリリースされたので使ってみた
                                                                1