রুম
| সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | রিলিজ প্রার্থী | বিটা রিলিজ | আলফা রিলিজ |
|---|---|---|---|---|
| ০৯ সেপ্টেম্বর, ২০২৬ | ২.৮.৫ | - | - | - |
নির্ভরতা ঘোষণা করা
Room-এর উপর নির্ভরতা যোগ করতে হলে, আপনাকে আপনার প্রজেক্টে Google Maven রিপোজিটরি যোগ করতে হবে। আরও তথ্যের জন্য Google-এর Maven রিপোজিটরি পড়ুন।
Room-এর নির্ভরশীলতার মধ্যে রয়েছে Room মাইগ্রেশন পরীক্ষা করা এবং Room RxJava।
আপনার অ্যাপ বা মডিউলের build.gradle ফাইলে প্রয়োজনীয় আর্টিফ্যাক্টগুলোর ডিপেন্ডেন্সি যোগ করুন:
কোটলিন
dependencies { val room_version = "2.8.4" implementation("androidx.room:room-runtime:$room_version") // If this project uses any Kotlin source, use Kotlin Symbol Processing (KSP) // See Add the KSP plugin to your project ksp("androidx.room:room-compiler:$room_version") // If this project only uses Java source, use the Java annotationProcessor // No additional plugins are necessary annotationProcessor("androidx.room:room-compiler:$room_version") // optional - Kotlin Extensions and Coroutines support for Room implementation("androidx.room:room-ktx:$room_version") // optional - RxJava2 support for Room implementation("androidx.room:room-rxjava2:$room_version") // optional - RxJava3 support for Room implementation("androidx.room:room-rxjava3:$room_version") // optional - Guava support for Room, including Optional and ListenableFuture implementation("androidx.room:room-guava:$room_version") // optional - Test helpers testImplementation("androidx.room:room-testing:$room_version") // optional - Paging 3 Integration implementation("androidx.room:room-paging:$room_version") }
গ্রোভি
dependencies { def room_version = "2.8.4" implementation "androidx.room:room-runtime:$room_version" // If this project uses any Kotlin source, use Kotlin Symbol Processing (KSP) // See KSP Quickstart to add KSP to your build ksp "androidx.room:room-compiler:$room_version" // If this project only uses Java source, use the Java annotationProcessor // No additional plugins are necessary annotationProcessor "androidx.room:room-compiler:$room_version" // optional - RxJava2 support for Room implementation "androidx.room:room-rxjava2:$room_version" // optional - RxJava3 support for Room implementation "androidx.room:room-rxjava3:$room_version" // optional - Guava support for Room, including Optional and ListenableFuture implementation "androidx.room:room-guava:$room_version" // optional - Test helpers testImplementation "androidx.room:room-testing:$room_version" // optional - Paging 3 Integration implementation "androidx.room:room-paging:$room_version" }
KAPT প্লাগইন ব্যবহারের তথ্যের জন্য, KAPT ডকুমেন্টেশন দেখুন।
KSP প্লাগইন ব্যবহারের তথ্যের জন্য, KSP কুইক-স্টার্ট ডকুমেন্টেশন দেখুন।
কোটলিন এক্সটেনশন ব্যবহারের তথ্যের জন্য, ktx ডকুমেন্টেশন দেখুন।
নির্ভরতা সম্পর্কে আরও তথ্যের জন্য, 'বিল্ড নির্ভরতা যোগ করুন ' দেখুন।
ঐচ্ছিকভাবে, নন-অ্যান্ড্রয়েড লাইব্রেরির (অর্থাৎ শুধুমাত্র জাভা বা কোটলিন গ্রেডল মডিউল) জন্য, আপনি Room অ্যানোটেশন ব্যবহার করতে androidx.room:room-common এর উপর নির্ভর করতে পারেন।
কম্পাইলার বিকল্পগুলি কনফিগার করা
Room-এ নিম্নলিখিত অ্যানোটেশন প্রসেসর অপশনগুলো রয়েছে।
room.schemaLocation | directoryপ্রদত্ত ডিরেক্টরিতে ডাটাবেস স্কিমা JSON ফাইলে রপ্তানি করার সুবিধা দেয়। আরও তথ্যের জন্য রুম মাইগ্রেশন দেখুন। |
room.incremental | booleanগ্রেডল ইনক্রিমেন্টাল অ্যানোটেশন প্রসেসর সক্রিয় করে। ডিফল্ট মান হলো true । |
room.generateKotlin | booleanজাভার পরিবর্তে কোটলিন সোর্স ফাইল তৈরি করুন। এর জন্য KSP প্রয়োজন। সংস্করণ ২.৭.০ অনুযায়ী এর ডিফল্ট মান হলো true । আরও বিস্তারিত জানতে সংস্করণ ২.৬.০-এর নোট দেখুন, যখন এটি প্রথম চালু করা হয়েছিল। |
রুম গ্রেডল প্লাগইন ব্যবহার করুন
Room ভার্সন ২.৬.০ এবং তার পরবর্তী সংস্করণগুলোতে, আপনি Room কম্পাইলারের অপশনগুলো কনফিগার করার জন্য Room Gradle Plugin ব্যবহার করতে পারেন। এই প্লাগইনটি প্রজেক্টকে এমনভাবে কনফিগার করে, যাতে জেনারেটেড স্কিমাগুলো (যা কম্পাইল টাস্কের আউটপুট এবং অটো-মাইগ্রেশনের জন্য ব্যবহৃত হয়) রিপ্রডিউসিবল ও ক্যাশেযোগ্য বিল্ডের জন্য সঠিকভাবে কনফিগার করা থাকে।
প্লাগইনটি যোগ করতে, আপনার শীর্ষ-স্তরের গ্রেডল বিল্ড ফাইলে প্লাগইন এবং এর সংস্করণটি নির্ধারণ করুন।
গ্রুভি
plugins { id 'androidx.room' version "$room_version" apply false }
কোটলিন
plugins { id("androidx.room") version "$room_version" apply false }
মডিউল-স্তরের গ্রেডল বিল্ড ফাইলে প্লাগইনটি প্রয়োগ করুন এবং room এক্সটেনশনটি ব্যবহার করুন।
গ্রুভি
plugins { id 'androidx.room' } android { ... room { schemaDirectory "$projectDir/schemas" } }
কোটলিন
plugins { id("androidx.room") } android { ... room { schemaDirectory("$projectDir/schemas") } }
Room Gradle Plugin ব্যবহার করার সময় একটি schemaDirectory সেট করা আবশ্যক। এটি Room কম্পাইলার এবং বিভিন্ন কম্পাইল টাস্ক ও এর ব্যাকএন্ডগুলোকে (javac, KAPT, KSP) ফ্লেভারড ফোল্ডারে স্কিমা ফাইল আউটপুট করার জন্য কনফিগার করবে, যেমন schemas/flavorOneDebug/com.package.MyDatabase/1.json । ভ্যালিডেশন এবং অটো-মাইগ্রেশনের জন্য এই ফাইলগুলো রিপোজিটরিতে চেক-ইন করা উচিত।
Room Gradle Plugin-এর সব সংস্করণে কিছু অপশন কনফিগার করা যায় না, যদিও সেগুলো Room কম্পাইলার দ্বারা সমর্থিত। নিচের সারণিতে প্রতিটি অপশনের তালিকা দেওয়া হয়েছে এবং Room Gradle Plugin-এর সেই সংস্করণটি দেখানো হয়েছে, যেটি room এক্সটেনশন ব্যবহার করে সেই অপশনটি কনফিগার করার জন্য সমর্থন যোগ করেছে। যদি আপনার সংস্করণটি নিম্নতর হয়, অথবা যদি অপশনটি এখনও সমর্থিত না হয়ে থাকে, তবে আপনি এর পরিবর্তে অ্যানোটেশন প্রসেসর অপশন ব্যবহার করতে পারেন।
| বিকল্প | সংস্করণ থেকে |
|---|---|
room.schemaLocation (প্রয়োজনীয়) | ২.৬.০ |
room.incremental | - |
room.generateKotlin | - |
অ্যানোটেশন প্রসেসর বিকল্পগুলি ব্যবহার করুন
আপনি যদি Room Gradle Plugin ব্যবহার না করেন, অথবা আপনার কাঙ্ক্ষিত অপশনটি যদি প্লাগইনের আপনার সংস্করণে সমর্থিত না হয়, তাহলে আপনি ‘Add build dependencies’ অংশে বর্ণিত পদ্ধতি অনুযায়ী অ্যানোটেশন প্রসেসর অপশন ব্যবহার করে Room কনফিগার করতে পারেন। আপনি Room-এর জন্য KSP নাকি KAPT ব্যবহার করছেন, তার উপর নির্ভর করে অ্যানোটেশন অপশনগুলো কীভাবে নির্দিষ্ট করবেন।
গ্রুভি
// For KSP ksp { arg("option_name", "option_value") // other otions... } // For javac and KAPT android { ... defaultConfig { ... javaCompileOptions { annotationProcessorOptions { arguments += [ "option_name":"option_value", // other options... ] } } } }
কোটলিন
// For KSP ksp { arg("option_name", "option_value") // other options... } // For javac and KAPT android { ... defaultConfig { ... javaCompileOptions { annotationProcessorOptions { arguments += mapOf( "option_name" to "option_value", // other options... ) } } } }
যেহেতু room.schemaLocation একটি ডিরেক্টরি এবং কোনো প্রিমিটিভ টাইপ নয়, তাই এই অপশনটি যোগ করার সময় একটি CommandLineArgumentsProvider ব্যবহার করা আবশ্যক, যাতে আপ-টু-ডেট চেক করার সময় Gradle এই ডিরেক্টরিটি সম্পর্কে জানতে পারে। "Migrate your Room database" অংশে CommandLineArgumentsProvider এর একটি সম্পূর্ণ ইমপ্লিমেন্টেশন দেখানো হয়েছে, যা স্কিমা লোকেশন প্রদান করে।
প্রতিক্রিয়া
আপনার মতামত জেটপ্যাককে আরও উন্নত করতে সাহায্য করে। আপনি যদি নতুন কোনো সমস্যা খুঁজে পান অথবা এই লাইব্রেরিটি উন্নত করার জন্য কোনো ধারণা থাকে, তবে আমাদের জানান। নতুন কোনো সমস্যা তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরির বিদ্যমান সমস্যাগুলো দেখে নিন। আপনি তারকা বোতামে ক্লিক করে কোনো বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ ২.৮
সংস্করণ ২.৮.৫
০৯ সেপ্টেম্বর, ২০২৬
androidx.room:room-*:2.8.5 প্রকাশিত হয়েছে। সংস্করণ 2.8.5-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ডাটাবেস বন্ধ করার পরে কল করা হলে, রুম সাসপেন্ডিং কোয়েরি এবং ইনভ্যালিডেশন ট্র্যাকার অপারেশনগুলো এখন একটি
IllegalStateExceptionথ্রো করবে। ( Ic0166 , b/543076356 )
সংস্করণ ২.৮.৪
১৯ নভেম্বর, ২০২৫
androidx.room:room-*:2.8.4 প্রকাশিত হয়েছে। সংস্করণ 2.8.4-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- এমন কোনো
SQLiteDriverব্যবহার করার সময় Room-এর কানেকশন পুলে একটি প্রিপেয়ার্ড স্টেটমেন্ট ক্যাশে যোগ করা হয়েছে, যার নিজস্ব কোনো পুল নেই, যেমনBundledSQLiteDriver। এটি একই SQL স্টেটমেন্ট বারবার চালানোর ক্ষেত্রে পারফরম্যান্স উন্নত করে। ( 5f43bc , b/319653917 ) - স্কিমা যাচাইকরণের সময় প্রকৃত / প্রত্যাশিত ত্রুটি বার্তায় তথ্যের ঘাটতি থাকার সমস্যাটি সমাধান করা হয়েছে। ( 8b23da , b/454531083 )
- Room-এর Kotlin কোড জেনারেশনে টাইপ ভেরিয়েবল সহ
@TransactionDAO ফাংশনগুলো অনুপস্থিত থাকার সমস্যাটি সমাধান করা হয়েছে। ( a8365d , b/251316420 ) -
SupportSQLiteDatabaseAPI-গুলোর মতো একই ব্লকিং আচরণ বজায় রেখে থ্রেড হপ পরিহার করার মাধ্যমে Room-এরSupportSQLiteWrapper-এর পারফরম্যান্স উন্নত করুন। ( fc70e4 )
সংস্করণ ২.৮.৩
২২ অক্টোবর, ২০২৫
androidx.room:room-*:2.8.3 প্রকাশিত হয়েছে। সংস্করণ 2.8.3-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Room SQLite Wrapper-এর একটি পারফরম্যান্স সমস্যা সমাধান করা হয়েছে, যা একটি Cursor-এর উপর ইটারেট করার সময় অতিরিক্ত JNI কল এবং পারফরম্যান্সের উল্লেখযোগ্য অবনতির কারণ হচ্ছিল।
সংস্করণ ২.৮.২
০৮ অক্টোবর, ২০২৫
androidx.room:room-*:2.8.2 প্রকাশিত হয়েছে। সংস্করণ 2.8.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ফ্লো এমিশন থেকে স্বয়ংক্রিয়ভাবে বন্ধ হয়ে যাওয়া ডেটাবেস পুনরায় খোলার সময় ঘটতে পারে এমন একটি ডেডলক ঠিক করা হয়েছে ( b/446643789 )।
সংস্করণ ২.৮.১
২৪ সেপ্টেম্বর, ২০২৫
androidx.room:room-*:2.8.1 প্রকাশিত হয়েছে। সংস্করণ 2.8.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- সাসপেন্ড ল্যাম্বডা সহ একটি DAO ফাংশন প্রসেস করার সময় যে প্রসেসর ক্র্যাশটি ঘটত, তা ঠিক করা হয়েছে। ( b/442220723 )।
- একটি রেস কন্ডিশন ঠিক করা হয়েছে, যার কারণে ফ্লো (Flow) সর্বশেষ আপডেটটি গ্রহণ করতে পারছিল না।
সংস্করণ ২.৮.০
১০ সেপ্টেম্বর, ২০২৫
androidx.room:room-*:2.8.0 প্রকাশিত হয়েছে। সংস্করণ 2.8.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
২.৭.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ:
-
androidx.room:room-sqlite-wrapperএকটি নতুন আর্টিফ্যাক্ট যোগ করা হয়েছে, যাতে কনফিগার করাSQLiteDriverসহ একটিRoomDatabaseথেকেSupportSQLiteDatabaseর্যাপার পাওয়ার জন্য API রয়েছে। র্যাপারটি পেতে নতুন এক্সটেনশন ফাংশনRoomDatabase.getSupportWrapper()ব্যবহার করুন। এটি একটি কম্প্যাটিবিলিটি আর্টিফ্যাক্ট, যা Room ডেটাবেসটিSQLiteDriverদিয়ে কনফিগার করা থাকলেওSupportSQLiteDatabaseএর ব্যবহার বজায় রাখে, যা সাধারণতroomDatabase.openHelper.writableDatabaseথেকে পাওয়া যায়। এই র্যাপারটি সেইসব কোডবেসের ইনক্রিমেন্টাল মাইগ্রেশনের জন্য উপযোগী, যারা SQLiteDriver API গ্রহণ করতে চায় কিন্তু SupportSQLite API-এর ব্যাপক ব্যবহার করে এবংBundledSQLiteDriverএর সুবিধাও নিতে চায়। আরও তথ্যের জন্য মাইগ্রেশন গাইডটি দেখুন। - KMP টার্গেট Watch OS এবং Tv OS-এর জন্য সমর্থন যোগ করা হয়েছে।
- লাইব্রেরির অ্যান্ড্রয়েড minSDK এপিআই ২১ থেকে এপিআই ২৩-এ আপডেট করা হয়েছে।
সংস্করণ 2.8.0-rc02
২৭ আগস্ট, ২০২৫
androidx.room:room-*:2.8.0-rc02 প্রকাশিত হয়েছে। সংস্করণ 2.8.0-rc02-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- minSDK-কে API 21 থেকে API 23-এ আপডেট করুন ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
- Room Gradle Plugin-এর সাথে সামঞ্জস্যপূর্ণ সর্বনিম্ন Android Gradle Plugin (AGP) সংস্করণটি 8.1 থেকে 8.4-এ আপডেট করুন। ( Ia0d28 )
বাগ সংশোধন
- একটি প্রি-প্যাকেজড ডাটাবেসের জন্য মাইগ্রেশন পাথ উপলব্ধ থাকা সত্ত্বেও ডেস্ট্রাকটিভ মাইগ্রেশন সম্পাদিত হওয়ার সমস্যাটি সমাধান করা হয়েছে ( b/432634197 )।
সংস্করণ 2.8.0-rc01
১৩ আগস্ট, ২০২৫
androidx.room:room-*:2.8.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 2.8.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
বাগ সংশোধন
- একটি রেস কন্ডিশন সংশোধন করা হয়েছে যেখানে রুম ফ্লো একটি অ্যাসিঙ্ক্রোনাস মাল্টি-কোয়েরি/রাইট পরিস্থিতিতে সর্বশেষ কোয়েরির ফলাফল নির্গত করত না। ( Ic9a3c )
সংস্করণ 2.8.0-beta01
১ আগস্ট, ২০২৫
androidx.room:room-*:2.8.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 2.8.0-beta01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ধ্বংসাত্মক মাইগ্রেশনের সময় টেবিল এবং ভিউয়ের নামগুলো এখন সঠিকভাবে এস্কেপ করা হয়। ( 9e55f8 , b/427095319 )
সংস্করণ ২.৮.০-আলফা০১
১৬ জুলাই, ২০২৫
androidx.room:room-*:2.8.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 2.8.0-alpha01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নতুন বৈশিষ্ট্য
-
androidx.room:room-sqlite-wrapperএকটি নতুন আর্টিফ্যাক্ট যোগ করা হয়েছে, যাতে কনফিগার করাSQLiteDriverসহRoomDatabaseএর একটিSupportSQLiteDatabaseর্যাপার পাওয়ার জন্য API রয়েছে। র্যাপারটি পেতে নতুন এক্সটেনশন ফাংশনRoomDatabase.getSupportWrapper()ব্যবহার করুন। এটি একটি কম্প্যাটিবিলিটি আর্টিফ্যাক্ট, যাSupportSQLiteDatabaseএর ব্যবহার বজায় রাখার জন্য তৈরি, যা সাধারণতRoomDatabase.openHelper.writableDatabaseথেকে পাওয়া যায়, এমনকি যদি Room ডেটাবেসটি একটিSQLiteDriverদিয়ে কনফিগার করা থাকে। এই র্যাপারটি সেইসব কোডবেসের ইনক্রিমেন্টাল মাইগ্রেশনের জন্য উপযোগী, যারাSQLiteDriverগ্রহণ করতে চায় কিন্তুSupportSQLiteAPI-এর ব্যাপক ব্যবহার করে এবংBundledSQLiteDriverএর সুবিধাও নিতে চায়। ( Icf6ac ) - Watch OS এবং TV OS-এর জন্য KMP টার্গেট যোগ করুন ( I228f6 , b/394238801 )
বাগ সংশোধন
- সাসপেন্ডিং ট্রানজ্যাকশন এবং
AndroidSQLiteDriverব্যবহারের সময় মাঝে মাঝে ঘটতে থাকা একটি ডেডলক ঠিক করা হয়েছে। ( b/415006268 )
সংস্করণ ২.৭
সংস্করণ ২.৭.২
১৮ জুন, ২০২৫
androidx.room:room-*:2.7.2 প্রকাশিত হয়েছে। সংস্করণ 2.7.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- KSP দিয়ে নেটিভ সোর্স প্রসেস করার সময় অ্যানোটেশন ভ্যালুগুলো ভুলভাবে পঠিত হওয়ার এবং মাঝে মাঝে স্কিমা এক্সপোর্ট অনুপস্থিত থাকার সমস্যাটি সমাধান করা হয়েছে। ( b/416549580 )
- একটি বাগ সংশোধন করা হয়েছে যেখানে SQL-এর শুরুতে থাকা কমেন্টের কারণে স্টেটমেন্টগুলো নন-রিড কোয়েরি হিসেবে এক্সিকিউট হতো। ( b/413061402 )
- স্কিমা ডিরেক্টরি খালি থাকার কারণে Room-এর Gradle প্লাগইন কনফিগার হতে ব্যর্থ হওয়ার সমস্যাটি সমাধান করা হয়েছে। ( b/417823384 )
- কানেকশন পেতে খুব বেশি সময় লাগলে এখন থেকে আর
SQLiteExceptionথ্রো করা হবে না, পরিবর্তে লাইব্রেরিটি একটি লগ মেসেজ পাঠাবে। থ্রো করার পরিবর্তে লগিং করার এই পদ্ধতিটি iOS-এর লুপার সাসপেন্ড করার সমস্যাটি সমাধান করে, যার ফলে কানেকশন গ্রহণকারী Kotlin Coroutine-এ ঘটা টাইমআউটকে Room ভুলভাবে ব্যাখ্যা করে। এর ফলে, কোনো ডাটাবেস অপারেশনের মাঝখানে iOS অ্যাপ ব্যাকগ্রাউন্ডে গিয়ে পরে আবার চালু হলেও এক্সেপশনটি থ্রো হওয়া থেকে বিরত থাকে। ( b/422448815 )
সংস্করণ ২.৭.১
২৩ এপ্রিল, ২০২৫
androidx.room:room-*:2.7.1 প্রকাশিত হয়েছে। সংস্করণ 2.7.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- প্রদত্ত টাইপ কনভার্টার যাচাইকরণের সময়
IndexOutOfBoundsExceptionবাগটি সংশোধন করা হয়েছে। ( b/409804755 )। - যখন একটি
SQLiteDriverRoom দিয়ে কনফিগার করা হয়, তখনRoomDatabase.runInTransaction()সমর্থন করুন। ( b/408364828 )।
সংস্করণ ২.৭.০
৯ এপ্রিল, ২০২৫
androidx.room:room-*:2.7.0 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
২.৬.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
- কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) সাপোর্ট: এই রিলিজে, Room-কে রিফ্যাক্টর করে একটি কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) লাইব্রেরি হিসেবে তৈরি করা হয়েছে। বর্তমানে সমর্থিত প্ল্যাটফর্মগুলো হলো অ্যান্ড্রয়েড, আইওএস, জেভিএম (ডেস্কটপ), নেটিভ ম্যাক এবং নেটিভ লিনাক্স। Room KMP ব্যবহার শুরু করার পদ্ধতি সম্পর্কে আরও তথ্যের জন্য, অনুগ্রহ করে অফিসিয়াল Room KMP ডকুমেন্টেশন দেখুন। KMP সাপোর্টের অংশ হিসেবে, Room-কে একটি
SQLiteDriverদিয়েও কনফিগার করা যায়। একটি বিদ্যমান অ্যাপকে ড্রাইভার এপিআই এবং Room KMP-তে মাইগ্রেট করার পদ্ধতি সম্পর্কে তথ্যের জন্য, মাইগ্রেশন ডকুমেন্টেশন দেখুন। - KSP-এর মাধ্যমে প্রসেসিং করা হলে, KSP-তে কোটলিন কোড জেনারেশন ডিফল্টরূপে চালু থাকে। KAPT বা শুধুমাত্র জাভা-ভিত্তিক প্রোজেক্টের ক্ষেত্রে, Room তার নিজস্ব জাভা সোর্স কোড তৈরি করবে।
- Kotlin 2.0 এবং KSP2: Room এখন Kotlin 2.0 ভাষাকে টার্গেট করে এবং প্রোজেক্টগুলোকেও Kotlin 2.0 এবং এর সমতুল্য বা উচ্চতর সংস্করণ দিয়ে কম্পাইল করতে হবে। KSP2-এর জন্য সাপোর্টও যোগ করা হয়েছে এবং Kotlin 2.0 বা তার উচ্চতর সংস্করণের সাথে Room ব্যবহার করার ক্ষেত্রে এটি ব্যবহার করার পরামর্শ দেওয়া হয়।
সংস্করণ 2.7.0-rc03
২৬ মার্চ, ২০২৫
androidx.room:room-*:2.7.0-rc03 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc03-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Room ব্লকিং API, যার মধ্যে ব্লকিং DAO ফাংশনও অন্তর্ভুক্ত, তার নির্বাহ চলাকালীন কোনো থ্রেড বাধাগ্রস্ত হলে এখন থেকে আর
InterruptedExceptionথ্রো করা হবে না ( b/400584611 )। -
SQLException: Error code: 5, message: Timed out attempting to acquire a reader connection.এবং অনুরূপ সমস্যাগুলো ( b/380088809 ) সমাধানের চেষ্টায় Room-এর কানেকশন পুল পুনরায় বাস্তবায়ন করুন।
সংস্করণ 2.7.0-rc02
১২ মার্চ, ২০২৫
androidx.room:room-*:2.7.0-rc02 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc02-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- FTS টেবিলে একটি নতুন কলামকে অটো মাইগ্রেশন ভুলভাবে পরিচালনা করার সমস্যাটি সমাধান করা হয়েছে। ( b/348227770 , Ic53f3 )
- KSP-এর মাধ্যমে নন-JVM সোর্স প্রসেস করার সময়
NullPointerExceptionকারণে রুম-কম্পাইলার ক্র্যাশ হওয়ার সমস্যাটি সমাধান করা হয়েছে। ( b/396607230 , I693c9 ) - রাইটার কানেকশন ব্যবহার শেষে Room যে টেবিলগুলো ইনভ্যালিডেট করত না, সেই সমস্যাটি সমাধান করা হয়েছে। ( b/340606803 , I73ef6 )
সংস্করণ 2.7.0-rc01
২৬ ফেব্রুয়ারি, ২০২৫
androidx.room:room-*:2.7.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি সমস্যার সমাধান করা হয়েছে যেখানে Room প্রাথমিক ডাটাবেস সংযোগের সময়
busy_timeoutসেট করত না, যার ফলেSQLException: Error code: 5, message: database is lockedসমস্যা দেখা দিত ( I93208 , b/380088809 )। - Kotlin 2.1.x এবং KSP1-এ নেটিভ সোর্স সেট (যেমন iOS) প্রসেস করার সময় KSP প্রসেসর ক্র্যাশ করার কারণ হওয়া Room-এর কম্পাইলারের একটি সমস্যা সমাধান করা হয়েছে ( I883b8 , b/396607230 )।
সংস্করণ 2.7.0-beta01
১২ ফেব্রুয়ারী, ২০২৫
androidx.room:room-*:2.7.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-beta01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
RoomDatabase.inTransaction()ফাংশনটির একটি সমস্যা সমাধান করা হয়েছে, যেখানে এটি অকারণে একটি বন্ধ ডেটাবেস খুলে ফেলছিল এবং ডেটাবেসটি বন্ধ থাকলে দ্রুত false রিটার্ন করার কথা ( b/325432967 )। - Kotlin ইনলাইন / ভ্যালু ক্লাস ব্যবহার করে DAO ফাংশন প্রসেস করার সময় Room-এর কম্পাইলারে একটি ক্র্যাশ (
IllegalArgumentException: not a valid name) ঠিক করা হয়েছে ( b/388299754 )। -
room-runtimeএর JVM আর্টিফ্যাক্টে Proguard নিয়মগুলি অন্তর্ভুক্ত করুন যাতে তৈরি হওয়া ডাটাবেস ইমপ্লিমেন্টেশনের ডিফল্ট কনস্ট্রাক্টরটি মুছে ফেলা না হয়, কারণ এটি Room-এর ডিফল্ট ইনিশিয়ালাইজেশনে ব্যবহৃত হয় যা রিফ্লেকশন ব্যবহার করে ( b/392657750 )।
সংস্করণ ২.৭.০-আলফা১৩
২৯ জানুয়ারী, ২০২৫
androidx.room:room-*:2.7.0-alpha13 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha13-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- Room এখন Kotlin ল্যাঙ্গুয়েজ 2.0-কে টার্গেট করে এবং প্রোজেক্টগুলোকেও Kotlin 2.0 এবং এর সমতুল্য বা উচ্চতর ভার্সন দিয়ে কম্পাইল করতে হবে। ( I8efb0 , b/315461431 , b/384600605 )
বাগ সংশোধন
- Room KMP ডাটাবেস বিল্ডারে একটি সমস্যার সমাধান করা হয়েছে, যেখানে অ্যান্ড্রয়েডে পাথের পরিবর্তে শুধু নাম ব্যবহার করা হলে ডাটাবেস ফাইলের রিজলভড পাথটি অ্যাপের ডেটা ডিরেক্টরিতে খুঁজে পাওয়া যেত না। ( I83315 , b/377830104 )
- Room Gradle Plugin-এর একটি সমস্যা সমাধান করা হয়েছে, যেখানে স্কিমা ইনপুট এবং আউটপুট কনফিগার করার কারণে অ্যান্ড্রয়েড প্রজেক্টে একটি জটিলতা সৃষ্টি হচ্ছিল:
property 'inputDirectory' is final and cannot be changed any further.( 1dbb4c , b/376071291 ) - Room Gradle প্লাগইনে KSP2-এর জন্য সমর্থন যোগ করা হয়েছে, যার ফলে প্লাগইন দ্বারা স্কিমা ডিরেক্টরি সঠিকভাবে সেট আপ না হওয়ার সমস্যাটি সমাধান করা হয়েছে। ( Iec3c4 , b/379159770 )
বাহ্যিক অবদান
-
Roomপেজিং ইন্টিগ্রেশনের একটি সমস্যা সমাধান করা হয়েছে, যার ফলে রিফ্রেশ করার জন্য প্রাথমিক কী-টি তালিকার শেষের খুব কাছাকাছি চাপলে UI লাফিয়ে উঠত। ইভাকে ধন্যবাদ! ( I2abbe , b/389729367 )
সংস্করণ ২.৭.০-আলফা১২
১১ ডিসেম্বর, ২০২৪
androidx.room:room-*:2.7.0-alpha12 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha12-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- ইনভ্যালিডেশন ট্র্যাকিংয়ের জন্য Room ইন-মেমরি টেবিল ব্যবহার করবে কি না, তা কনফিগার করতে পরীক্ষামূলক API
RoomDatabase.Builder.setInMemoryTrackingMode()যোগ করুন। ( I2a9b2 , b/185414040 )
বাগ সংশোধন
- ধ্বংসাত্মক মাইগ্রেশন এখন ভিউগুলোকে ড্রপ করে দেয় যাতে সেগুলো পুনরায় তৈরি হয়, যা
allowDestructiveMigrationForAllTablesON (KMP ডিফল্ট) থাকা অবস্থার আচরণকে, এটি OFF থাকা অবস্থার বিদ্যমান আচরণের সাথে সামঞ্জস্যপূর্ণ করে। ( 0a3e83 , b/381518941 )
সংস্করণ ২.৭.০-আলফা১১
৩০ অক্টোবর, ২০২৪
androidx.room:room-*:2.7.0-alpha11 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha11-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- রুম-পেজিংয়ের জন্য একটি
RawRoomQueryগ্রহণকারী একটি সাসপেন্ড ফাংশন হিসেবে নতুন যুক্ত হওয়াconvertRows()মেথডের সিগনেচারটি পুনর্বিবেচনা করুন। ( Ie57b5 , b/369136627 )
বাগ সংশোধন
- রুম-পেজিং-এর সেই সমস্যাটি সমাধান করা হয়েছে, যেখানে
PagingSourceসাথে@Relationব্যবহার করার সময় অবৈধ কোড তৈরি হচ্ছিল।
সংস্করণ ২.৭.০-আলফা১০
১৬ অক্টোবর, ২০২৪
androidx.room:room-*:2.7.0-alpha10 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha10-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- নন-অ্যান্ড্রয়েড ও নন-জেভিএম প্ল্যাটফর্মে
ByteBufferসাথে রিলেশন সমর্থন করার জন্য অভ্যন্তরীণByteArrayWrapperক্লাস তৈরি করুন। ( I75543 , b/367205685 ) - একটি কলামের ডেটা টাইপ পুনরুদ্ধার করা সক্ষম করতে, বিভিন্ন
SQLITE_DATA_*ফলাফল কনস্ট্যান্টের সাথেSQLiteStatement.getColumnType()যোগ করুন। ( I1985c , b/369636251 )
সংস্করণ ২.৭.০-আলফা০৯
২ অক্টোবর, ২০২৪
androidx.room:room-*:2.7.0-alpha09 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha09-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
room-paging-এর KMP ইমপ্লিমেন্টেশনের একটি সমস্যা সমাধান করা হয়েছে, যার ফলে একটি রিড কানেকশনে রাইট ট্রানজ্যাকশন শুরু করার কারণেError code: 8, message: attempt to write a readonly databaseদেখা দিত। ( b/368380988 )
সংস্করণ ২.৭.০-আলফা০৮
১৮ সেপ্টেম্বর, ২০২৪
androidx.room:room-*:2.7.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha08-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নতুন বৈশিষ্ট্য
-
room-pagingআর্টিফ্যাক্টগুলোকে KMP-উপযোগী করার জন্য মাইগ্রেট করা হয়েছে। ( Ib8756 , b/339934824 ) -
invalidationTrackerFlow()API-টি এখনInvalidationTracker.createFlow()নামে একটি ফার্স্ট-পার্টি API হিসেবে প্রচলিত হয়েছে এবং KMP প্রোজেক্টের নন-অ্যান্ড্রয়েড সোর্স সেটের জন্য উপলব্ধ। ( I1fbfa , ( I8fb29 ), b/329291639 , b/329315924 )
এপিআই পরিবর্তন
- Room-এর সেই সমস্ত সতর্কীকরণ এবং ত্রুটির বার্তাগুলি, যেগুলিতে
Cursorশব্দটি ব্যবহৃত হয়েছিল, সেগুলি সরিয়ে ফেলা হয়েছে বা প্রতিস্থাপন করা হয়েছে, কারণ Room-এর KMP সংস্করণে ব্যবহারের জন্যCursorআর একটি সঠিক সাধারণ পরিভাষা নয়। ( Id8cd9 , b/334087492 )
বাগ সংশোধন
- নন-জেভিএম প্ল্যাটফর্মের ক্ষেত্রে রুম কেএমপি (Room KMP)
UUIDব্যবহার করে কোড নির্গমনের চেষ্টা করত, সেই সমস্যাটি সমাধান করা হয়েছে। ( b/362994709 ) - Room Gradle Plugin-এর একটি সমস্যা সমাধান করা হয়েছে, যা Compose Multiplatform সহ একটি KMP প্রোজেক্টে ব্যবহার করার সময় 'Cannot change attributes of configuration … after it has been locked for mutation'-এর মতো একটি ত্রুটি সৃষ্টি করত। ( b/343408758 )
সংস্করণ ২.৭.০-আলফা০৭
২১শে আগস্ট, ২০২৪
androidx.room:room-*:2.7.0-alpha07 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha07-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নতুন বৈশিষ্ট্য
- Room Gradle Plugin এখন স্বয়ংক্রিয়ভাবে এক্সপোর্ট করা স্কিমাগুলোকে Android Instrumentation Test রিসোর্স সোর্সগুলোতে যুক্ত করবে, যাতে
MigrationTestHelperসেগুলো ব্যবহার করতে পারে।
বাগ সংশোধন
-
RoomDatabaseConstructorএর তৈরি হওয়া 'actual'-এ একটি সমস্যার সমাধান করা হয়েছে, যেখানেinitializeফাংশনটি 'expect' ডিক্লারেশনে ওভাররাইড করা থাকলে সেই ফাংশনটিতে 'actual' মডিফায়ারটি অনুপস্থিত থাকত। ( 359631627 ) -
RoomDatabaseConstructorএর তৈরি হওয়া 'actual' ভিজিবিলিটি 'expect' ডিক্লারেশনের সাথে না মেলার সমস্যাটি সমাধান করা হয়েছে। ( 358138953 )
সংস্করণ ২.৭.০-আলফা০৬
৭ আগস্ট, ২০২৪
androidx.room:room-*:2.7.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha06-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
- একটি KMP প্রোজেক্টে
RoomDatabaseএর ইনস্ট্যানসিয়েশন সেটআপ পরিবর্তন করুন।
Kotlin 2.0 কম্পাইলেশন মডেলের কারণে, instantiateImpl() নামক একটি আসন্ন ফাংশনকে রেফারেন্স করার কৌশলটি আর কার্যকর নয়। @ConstructedBy এবং RoomDatabaseConstructor নামে দুটি নতুন API চালু করা হয়েছে যা instantiateImpl() কৌশলটিকে প্রতিস্থাপন করে। নতুন কৌশলটি নিম্নরূপ:
একটি expect অবজেক্ট সংজ্ঞায়িত করুন যা
RoomDatabaseConstructorইমপ্লিমেন্ট করে।expect object MyDatabaseCtor : RoomDatabaseConstructor<MyDatabase>@ConstructedByব্যবহার করে অবজেক্টটিকে@Databaseডিক্লারেশনের সাথে লিঙ্ক করুন।@Database(...) @ConstructedBy(MyDatabaseCtor::class) // NEW abstract class MyDatabase : RoomDatabaseফ্যাক্টরি আর্গুমেন্ট পাস না করে একটি নতুন ডাটাবেস ইনস্ট্যান্স তৈরি করুন।
fun createNewDatabase(path: String) = Room.databaseBuilder<AppDatabase>(name = path) .setDriver(BundledSQLiteDriver()) .setQueryCoroutineContext(Dispatchers.IO) .build()
b/316978491 , b/338446862 এবং b/342905180 ঠিক করা হয়েছে।
- Room KMP-তে
@RawQueryএর জন্য সমর্থন যোগ করা হয়েছেRoomRawQueryনামে একটি নতুন API যোগ করার মাধ্যমে, যা র SQL স্ট্রিং ধারণ করার ক্ষেত্রেSupportSQLiteQueryএর অনুরূপ এবং একটি স্টেটমেন্টে আর্গুমেন্ট বাইন্ড করার জন্য একটি ফাংশন প্রদান করে।@RawQueryঅ্যানোটেড ফাংশনগুলো এখন তাদের একমাত্র প্যারামিটার হিসেবে একটিRoomRawQueryগ্রহণ করতে পারে। ( Iea844 , b/330586815 ) -
setQueryCallback()এর একটি ওভারলোড যোগ করুন যা একটিCoroutineContextগ্রহণ করে। ( Id66ff , b/309996304 ) -
linuxArm64Kotlin মাল্টিপ্ল্যাটফর্ম টার্গেটগুলির জন্য সমর্থন যোগ করা হয়েছে ( I139d3 , b/338268719 )
বাগ সংশোধন
- নন-অ্যান্ড্রয়েড টার্গেটগুলিতে Room ভুলভাবে
recursiveFetchArrayMapকল তৈরি করার সমস্যাটি সমাধান করা হয়েছে। ( 710c36 , b/352482325 ) - একটি KMP প্রোজেক্টে Room মাঝে মাঝে 'Timed out attempting a connection' সংক্রান্ত একটি এক্সেপশন থ্রো করার সমস্যাটি সমাধান করা হয়েছে। ( fa72d0 , b/347737870 )
- স্বয়ংক্রিয় মাইগ্রেশনের একটি সমস্যা সমাধান করা হয়েছে, যেখানে অন্যান্য টেবিলগুলো নতুন ফরেন কী-গুলোর সাথে সামঞ্জস্য রেখে তাদের স্কিমা পরিবর্তন করার আগেই ফরেন কী-গুলো পরীক্ষা করা হতো। ( 7672c0 , b/352085724 )
সংস্করণ ২.৭.০-আলফা০৫
১০ জুলাই, ২০২৪
androidx.room:room-*:2.7.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha05-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
-
SQLiteKtকেSQLiteএবংBundledSQLiteKtকেBundledSQLiteনামে পুনঃনামকরণ করা হয়েছে। ( I8b501 )
বাগ সংশোধন
-
AndroidSQLiteDriverব্যবহার করার সময়RoomDatabaseডেডলক হয়ে যাওয়া বা কানেকশন টাইমআউটের কারণে এরর দেখানোর বাগটি সংশোধন করা হয়েছে।
সংস্করণ ২.৭.০-আলফা০৪
১২ জুন, ২০২৪
androidx.room:room-*:2.7.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha04-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Room-এর অ্যানোটেশন প্রসেসরের একটি সমস্যা সমাধান করা হয়েছে, যেখানে একটি DAO-তে মাল্টি-ম্যাপ রিটার্ন টাইপ সংজ্ঞায়িত করা হলে এটি বেমানান KMP কোড তৈরি করত। ( b/340983093 )
- একটি সমস্যার সমাধান করা হয়েছে যেখানে
@Databaseঅ্যানোটেড ক্লাসের কোনো প্যাকেজ না থাকলে Room তৈরি হওয়া ডাটাবেস ইমপ্লিমেন্টেশনটি খুঁজে পেতে ব্যর্থ হতো। ( b/342097292 ) - একটি সমস্যার সমাধান করা হয়েছে যেখানে অটো-ক্লোজ এবং মাল্টি-ইনস্ট্যান্স ইনভ্যালিডেশন চালু করলে, ডাটাবেস নিষ্ক্রিয় থাকার কারণে স্বয়ংক্রিয়ভাবে বন্ধ হয়ে গেলে মাঝে মাঝে একটি
ConcurrentModificationExceptionদেখা দিত।
সংস্করণ ২.৭.০-আলফা০৩
২৯ মে, ২০২৪
androidx.room:room-*:2.7.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha03-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Kotlin 2.0 এবং KSP 2.0 সম্পর্কিত বিভিন্ন সমস্যা সমাধান করা হয়েছে। উল্লেখ্য যে, KSP 2 সাপোর্টসহ Kotlin 2.0 এখনও সম্পূর্ণ নয় এবং টিম নতুন কম্পাইলারের বিভিন্ন API ও আচরণগত পরিবর্তন নিয়ে কাজ করছে। ( b/314151707 )
সংস্করণ 2.7.0-alpha02
১৪ মে, ২০২৪
androidx.room:room-*:2.7.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha02-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- KSP-এর বিভিন্ন সমস্যা সমাধান করা হয়েছে।
সংস্করণ ২.৭.০-আলফা০১
১ মে, ২০২৪
androidx.room:room-*:2.7.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নতুন বৈশিষ্ট্য
- কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) সাপোর্ট : এই রিলিজে, Room-কে রিফ্যাক্টর করে একটি কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) লাইব্রেরিতে পরিণত করা হয়েছে। যদিও এখনও কিছু কাজ বাকি আছে, এই রিলিজে Room-এর একটি নতুন সংস্করণ আনা হয়েছে যেখানে এর বেশিরভাগ কার্যকারিতাকে “কমন-ইজড” (মাল্টিপ্ল্যাটফর্ম উপযোগী) করা হয়েছে। বর্তমানে সমর্থিত প্ল্যাটফর্মগুলো হলো অ্যান্ড্রয়েড, আইওএস, জেভিএম (ডেস্কটপ), নেটিভ ম্যাক এবং নেটিভ লিনাক্স। নতুন সমর্থিত প্ল্যাটফর্মগুলোতে কোনো কার্যকারিতা অনুপস্থিত থাকলে, Room-এর আসন্ন রিলিজগুলোতে তা “ফিচার-কমপ্লিট” করে দেওয়া হবে।
Room KMP ব্যবহার শুরু করার পদ্ধতি সম্পর্কে আরও তথ্যের জন্য, অনুগ্রহ করে Room KMP-এর অফিসিয়াল ডকুমেন্টেশন দেখুন।
- KSP-এর মাধ্যমে প্রসেসিং করা হলে, KSP-তে কোটলিন কোড জেনারেশন ডিফল্টরূপে চালু থাকে। KAPT বা শুধুমাত্র জাভা-ভিত্তিক প্রোজেক্টের ক্ষেত্রে, Room তার নিজস্ব জাভা সোর্স কোড তৈরি করবে।
এপিআই পরিবর্তন
-
Room.databaseBuilder()এর একটি ওভারলোড যোগ করা হয়েছে যা একটি ল্যাম্বডা প্যারামিটার গ্রহণ করে। এটি Room দ্বারা জেনারেট করা ফাংশনের সাথে ব্যবহার করার জন্য তৈরি করা হয়েছে, যাতে জেনারেট করাRoomDatabaseইমপ্লিমেন্টেশন ইনস্ট্যানশিয়েট করার সময় রিফ্লেকশন ব্যবহার এড়ানো যায়। এর ব্যবহারের উদাহরণ হলো:
Room.databaseBuilder<MyDatabase>(
context = appContext,
name = dbFilePath,
factory = { MyDatabase::class.instantiateImpl() }
)
- বিল্ডারে একটি
CoroutineContextব্যবহার করে একটি Room কনফিগার করার জন্য একটি API যোগ করা হয়েছে:RoomDatabase.Builder.setQueryCoroutineContext। উল্লেখ্য যে, একটিRoomDatabaseশুধুমাত্রsetQueryExecutorব্যবহার করে এক্সিকিউটর অথবা একটি Coroutine context দিয়ে কনফিগার করা যায়, কিন্তু উভয় দিয়ে নয়। -
SQLiteড্রাইভার দিয়ে Room কনফিগার করার জন্য একটি API যোগ করা হয়েছে:RoomDatabase.Builder.setDriver()।SQLiteড্রাইভার API সম্পর্কে আরও তথ্যের জন্য SQLite KMP ডকুমেন্টেশন দেখুন। - ড্রাইভার এপিআই থেকে অন্তর্নিহিত
SQLiteConnectionঅ্যাক্সেস করার জন্য দুটি এপিআই যোগ করা হয়েছে:RoomDatabase.useReaderConnectionএবংRoomDatabase.useWriterConnection। - বিভিন্ন Room সম্পর্কিত কলব্যাকের এখন একটি ওভারলোডেড সংস্করণ রয়েছে যা
SupportSQLiteDatabaseএর পরিবর্তেSQLiteConnectionগ্রহণ করে। একটি KMP প্রকল্পে মাইগ্রেট করার সময় এগুলিকে ওভাররাইড করার উদ্দেশ্যে তৈরি করা হয়েছে। একটি অ্যান্ড্রয়েড অ্যাপে Room-এর ব্যবহার একটি সাধারণ KMP মডিউলে মাইগ্রেট করার বিষয়ে আরও তথ্যের জন্য মাইগ্রেশন গাইডটি দেখুন। কলব্যাকগুলি হলো:-
Migration.migrate(SQLiteConnection) -
AutoMigrationSpec.onPostMigrate(SQLiteConnection) -
RoomDatabase.Callback.onCreate(SQLiteConnection) -
RoomDatabase.Callback.onDestructiveMigration(SQLiteConnection) -
RoomDatabase.Callback.onOpen(SQLiteConnection)
-
- KTX আর্টিফ্যাক্ট
androidx.room:room-ktxএর সমস্ত API সহandroidx.room:room-runtimeএর সাথে একীভূত করা হয়েছে, আর্টিফ্যাক্টটি এখন খালি। অনুগ্রহ করে আপনার ডিপেন্ডেন্সি তালিকা থেকে এটি সরিয়ে ফেলুন।
সংস্করণ ২.৬
সংস্করণ ২.৬.১
২৯ নভেম্বর, ২০২৩
androidx.room:room-*:2.6.1 প্রকাশিত হয়েছে। সংস্করণ 2.6.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- জেনারেটেড কোডের একটি সমস্যার সমাধান করা হয়েছে, যেখানে
EntityCursorConverterএ Double কলামের ডিফল্ট মান 0.0-এর পরিবর্তে 0 সেট হয়ে যাচ্ছিল। Float টাইপ কলামের জন্য একই ধরনের একটি এজ-কেসের সম্ভাব্য সমাধানও অন্তর্ভুক্ত করা হয়েছে। ( Id75f5 , b/304584179 ) -
PagingSourceলোড করার সময় যে এক্সেপশনগুলো থ্রো করা হবে, সেগুলো এখন থেকে Throwable সম্বলিতLoadResult.Errorএর একটিLoadStateUpdateহিসেবে প্রোপাগেট হবে। এই এরর স্টেটটিPagingDataAdapter.loadStateFlow(Views)অথবাLazyPagingItems.loadState(Compose)-এর মাধ্যমে অবজার্ভ করা যাবে। উল্লেখ্য যে, এটি একটি আচরণগত পরিবর্তন, যেখানে অতীতে লোড এররগুলো সেই dao মেথড দ্বারা থ্রো করা একটি এক্সেপশন হিসেবে বাবল আপ করত, যা লোডটি ট্রিগার করেছিল। ( I93887 , b/302708983 )
সংস্করণ ২.৬.০
১৮ অক্টোবর, ২০২৩
androidx.room:room-*:2.6.0 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
২.৫.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
- রুম কেএসপি-তে ( 4297ec0 ) এখন কোটলিন কোড জেনারেশন (বা “কোটলিন কোডজেন”) চালু করার অপশনটি উপলব্ধ। রুমে কোটলিন কোডজেন চালু করতে, আপনার কেএসপি-র প্রসেসর অপশনগুলিতে
room.generateKotlinঅপশন নামটি যোগ করুন। কেএসপি-র জন্য প্রসেসর অপশন কীভাবে পাস করতে হয় সে সম্পর্কে আরও বিস্তারিত জানতে, কেএসপি ডকুমেন্টেশন দেখুন।
দ্রষ্টব্য: Kotlin CodeGen ব্যবহার করার সময়, এটি মনে রাখা গুরুত্বপূর্ণ যে কিছু অতিরিক্ত বিধিনিষেধ যোগ করা হয়েছে। Kotlin CodeGen-এ DAO গেটার বা DAO কোয়েরি হিসাবে অ্যাবস্ট্রাক্ট প্রপার্টি ব্যবহার করা নিষিদ্ধ, এবং এর পরিবর্তে সেগুলোকে ফাংশন হিসাবে পুনরায় লিখতে হবে, যাতে এই ভুল ধারণাটি এড়ানো যায় যে প্রপার্টির মান অপরিবর্তনীয় এবং এর একটি নির্দিষ্ট সংরক্ষিত ফলাফল রয়েছে। আরেকটি বিধিনিষেধ যা যোগ করা হয়েছে তা হলো, Room for Kotlin CodeGen-এ Nullable কালেকশন রিটার্ন টাইপ আর অনুমোদিত নয়।
সতর্কীকরণ: আপনি হয়তো দেখবেন যে Kotlin CodeGen ব্যবহার করার সময় আপনার প্রজেক্টগুলো nullability-র ক্ষেত্রে আরও কঠোর। Kotlin CodeGen-এ টাইপ আর্গুমেন্টের nullability গুরুত্বপূর্ণ, যেখানে Java-তে এটি বেশিরভাগ ক্ষেত্রে উপেক্ষা করা হয়। উদাহরণস্বরূপ, ধরা যাক আপনার একটি `Flow` আছে।
- Room গ্রেডল প্লাগইনের জন্য নতুন আর্টিফ্যাক্টটি
androidx.roomআইডি সহ Room-এ যুক্ত করা হয়েছে, যা গ্রেডল অ্যানোটেশন প্রসেসর অপশনের মাধ্যমে স্কিমার ইনপুট এবং আউটপুট সংক্রান্ত Room-এর বিভিন্ন বিদ্যমান সমস্যার সমাধান করে। আরও বিস্তারিত জানতে, Room ভার্সন 2.6.0-alpha02-এর রিলিজ নোট দেখুন। - KSP-এর জন্য এখন রুম এনটিটি-তে ভ্যালু ক্লাস সমর্থিত। ( 4194095 )
- Room-এ এখন DAO ফাংশনের নেস্টেড ম্যাপ রিটার্ন টাইপ সমর্থিত। ( I13f48 , 203008711 )
সংস্করণ 2.6.0-rc01
২০ সেপ্টেম্বর, ২০২৩
androidx.room:room-*:2.6.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
সংস্করণ 2.6.0-beta01
২৩শে আগস্ট, ২০২৩
androidx.room:room-*:2.6.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-beta01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- আপসার্ট চলাকালীন
2067 SQLITE_CONSTRAINT_UNIQUEএক্সেপশনটি থ্রো হলে, সেই বিশেষSQLiteএক্সেপশনটি হ্যান্ডেল করার জন্য আপসার্টের একটি আপডেট করা উচিত। ( If2849 , b/243039555 )
সংস্করণ ২.৬.০-আলফা০৩
৯ আগস্ট, ২০২৩
androidx.room:room-*:2.6.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-alpha03-এ এই কমিটগুলো রয়েছে।
নতুন বৈশিষ্ট্য
এপিআই পরিবর্তন
-
@MapInfoপ্রতিস্থাপন করার জন্য@MapColumnনামে একটি নতুন টাইপ অ্যানোটেশন তৈরি করা হয়েছে, যা এখন ডেপ্রিকেটেড (deprecated)। একটি@MapInfoঅ্যানোটেশনে প্রদত্ত প্রতিটি কলাম নামের (keyColumnName,valueColumnName, বা উভয়ই) জন্য, আপনাকে শুধুcolumnNameদিয়ে একটি@MapColumnঅ্যানোটেশন ডিক্লেয়ার করতে হবে এবং DAO ফাংশনের রিটার্ন টাইপে যে নির্দিষ্ট টাইপ আর্গুমেন্টটিকে রেফারেন্স করা হচ্ছে (ম্যাপের কী বা ভ্যালু), তার উপর অ্যানোটেশনটি ব্যবহার করতে হবে। এর কারণ হলো,@MapInfoমতো ফাংশনটির উপর ব্যবহার না হয়ে,@MapColumnঅ্যানোটেশনটি একটি DAO ফাংশনের রিটার্ন টাইপের মধ্যে থাকা টাইপ আর্গুমেন্টের উপর সরাসরি ব্যবহৃত হয়। আরও তথ্যের জন্য, অনুগ্রহ করে@MapColumnডকুমেন্টেশন দেখুন। ( Ib0305 , b/203008711 ) - সামঞ্জস্য দমন টীকাযুক্ত করতে API ফাইলগুলি আপডেট করা হয়েছে ( I8e87a , b/287516207 )
- Room Gradle প্লাগইন API-গুলো এমনভাবে আপডেট করা হয়েছে যাতে এখন আর সবসময় প্রতিটি ভ্যারিয়েন্টের জন্য আলাদা কনফিগারেশনের প্রয়োজন না হয়। এর মানে হলো, প্লাগইনটি একাধিক ডিরেক্টরি তৈরি না করেই সমস্ত ভ্যারিয়েন্টের জন্য একটি গ্লোবাল লোকেশন গ্রহণ করতে পারে, যা মাইগ্রেশনকে আরও মসৃণ করে তোলে। তবে এটি এতটাই নমনীয় যে, প্লাগইনের সুবিধাগুলো (পুনরাবৃত্তিযোগ্য এবং ক্যাশেযোগ্য বিল্ড) বজায় রেখেই ফ্লেভার বা বিল্ড টাইপ স্কিমা ম্যানুয়ালি কনফিগার করা যায়। ( I09d6f , b/278266663 )
বাগ সংশোধন
-
QueryInterceptorStatementএ একটি সম্ভাব্য মেমোরি লিক দুর্বলতা সমাধান করা হয়েছে। ( I193d1 ) -
QueryInterceptorDatabase execSQL()ফাংশনের ত্রুটিপূর্ণ আচরণ সংশোধন করা হয়েছে। ( Iefdc8 )
সংস্করণ 2.6.0-alpha02
২১ জুন, ২০২৩
androidx.room:room-*:2.6.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-alpha02-এ এই কমিটগুলো রয়েছে।
রুম গ্রেডল প্লাগইন
এই নতুন রিলিজে Room Gradle Plugin-এর জন্য androidx.room আইডি সহ একটি নতুন আর্টিফ্যাক্ট রয়েছে, যা Gradle অ্যানোটেশন প্রসেসর অপশনের মাধ্যমে স্কিমার ইনপুট এবং আউটপুট সংক্রান্ত Room-এর বিভিন্ন বিদ্যমান সমস্যার সমাধান করে। Room Gradle Plugin প্রজেক্টটিকে এমনভাবে কনফিগার করে যাতে অটো-মাইগ্রেশনের জন্য ব্যবহৃত এবং কম্পাইল টাস্কের আউটপুট হিসেবে প্রাপ্ত জেনারেটেড স্কিমাগুলো রিপ্রডিউসিবল ও ক্যাশেযোগ্য বিল্ডের জন্য সঠিকভাবে কনফিগার করা থাকে। প্লাগইনটি বেস স্কিমার অবস্থান কনফিগার করার জন্য একটি DSL প্রদান করে:
room {
schemaDirectory("$projectDir/schemas/")
}
এরপর প্লাগইনটি Room কম্পাইলার এবং বিভিন্ন কম্পাইল টাস্ক ও এর ব্যাকএন্ডগুলোকে (javac, KAPT, KSP) কনফিগার করবে, যাতে স্কিমা ফাইলগুলো ফ্লেভারড ফোল্ডারে আউটপুট হয়, যেমন— schemas/flavorOneDebug/com.package.MyDatabase/1.json । যথারীতি, এই ফাইলগুলো ভ্যালিডেশন এবং অটো-মাইগ্রেশনের জন্য রিপোজিটরিতে চেক-ইন করা হয়। অ্যানোটেশন প্রসেসর অপশনগুলোর পরিবর্তে প্লাগইনটি ব্যবহার শুরু করলে, বিদ্যমান স্কিমা ফাইলগুলোকে অবশ্যই প্লাগইন দ্বারা তৈরি ফ্লেভার ডিরেক্টরিতে কপি করতে হবে। এটি একটি এককালীন মাইগ্রেশন অপারেশন যা ম্যানুয়ালি করতে হবে। developers.android.com- এ থাকা স্কিমা ডকুমেন্টেশন ভবিষ্যতে আপডেট করা হবে, যখন প্রাপ্ত মতামতগুলো বিবেচনা করা হবে এবং প্লাগইনটি স্টেবল ভার্সনে পৌঁছাবে, তাই অনুগ্রহ করে এটি ব্যবহার করে দেখুন।
এপিআই পরিবর্তন
- SAM রূপান্তর ব্যবহারের অনুমতি দেওয়ার জন্য
RoomDatabase.QueryCallbackএকটি ফাংশনাল ইন্টারফেস হিসেবে সংজ্ঞায়িত করা হয়েছে। ( Iab8ea , b/281008549 )
বাগ সংশোধন
- জাভা থেকে কোটলিনে Room সোর্স মাইগ্রেশনের পর Robolectric-এ ডাটাবেস ইনস্ট্যানশিয়েট করার সময় উদ্ভূত সমস্যার সমাধান। ( Ic053c , b/274924903 )
সংস্করণ ২.৬.০-আলফা০১
২২ মার্চ, ২০২৩
androidx.room:room-*:2.6.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 2.6.0-alpha01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নতুন বৈশিষ্ট্য
- KSP-এর জন্য Room-এ ভ্যালু ক্লাস সমর্থন। Room এখন এনটিটি-তে ভ্যালু ক্লাস সমর্থন করতে সক্ষম। ( 4194095 )
- এখন Room ( 4297ec0 )-এ Kotlin কোড জেনারেশন (বা “Kotlin CodeGen”) সক্রিয় করা যাবে। Room-এ Kotlin CodeGen চালু করতে, আপনার KSP-এর প্রসেসর অপশনগুলিতে
room.generateKotlinঅপশন নামটি যোগ করুন। KSP-এর জন্য প্রসেসর অপশন কীভাবে পাস করতে হয় সে সম্পর্কে আরও বিস্তারিত জানতে, KSP ডকুমেন্টেশন দেখুন।
দ্রষ্টব্য: Kotlin CodeGen ব্যবহার করার সময়, এটি মনে রাখা গুরুত্বপূর্ণ যে কিছু অতিরিক্ত বিধিনিষেধ যোগ করা হয়েছে। Kotlin CodeGen-এ DAO গেটার বা DAO কোয়েরি হিসাবে অ্যাবস্ট্রাক্ট প্রপার্টি ব্যবহার করা নিষিদ্ধ, এবং এর পরিবর্তে সেগুলোকে ফাংশন হিসাবে পুনরায় লিখতে হবে, যাতে এই ভুল ধারণাটি এড়ানো যায় যে প্রপার্টির মান অপরিবর্তনীয় এবং এর একটি নির্দিষ্ট সংরক্ষিত ফলাফল রয়েছে। আরেকটি বিধিনিষেধ যা যোগ করা হয়েছে তা হলো, Room for Kotlin CodeGen-এ Nullable কালেকশন রিটার্ন টাইপ আর অনুমোদিত নয়।
সতর্কীকরণ: আপনি হয়তো দেখবেন যে Kotlin CodeGen ব্যবহার করার সময় আপনার প্রজেক্টগুলো nullability-র ক্ষেত্রে আরও কঠোর। Kotlin CodeGen-এ টাইপ আর্গুমেন্টের nullability গুরুত্বপূর্ণ, যেখানে Java-তে এটি বেশিরভাগ ক্ষেত্রে উপেক্ষা করা হয়। উদাহরণস্বরূপ, ধরা যাক আপনার একটি `Flow` আছে।
এপিআই পরিবর্তন
- DAO মেথডের রিটার্ন টাইপে নালযোগ্য কালেকশনের অর্থহীন ব্যবহার রোধ করা। ( I777dc , b/253271782 , b/259426907 )
- ইনভ্যালিডেশন ট্র্যাকারের পরিবর্তনগুলো নির্গত করে এমন একটি ফ্লো তৈরির জন্য একটি এপিআই যোগ করুন। এই এপিআইটি এমন স্ট্রিম তৈরির জন্য উপযোগী যেগুলোকে ডাটাবেসের পরিবর্তনে প্রতিক্রিয়া জানাতে হয়। ( I8c790 , b/252899305 )
বাগ সংশোধন
- Kotlin codegen-এ অ্যাবস্ট্রাক্ট প্রপার্টিগুলোকে DAO গেটার বা DAO কোয়েরি হিসেবে ব্যবহার করতে দেবেন না; এর পরিবর্তে সেগুলোকে ফাংশন হিসেবে পুনরায় লেখা উচিত, যাতে প্রপার্টির মান অপরিবর্তনীয় এবং এর একটি নির্দিষ্ট সংরক্ষিত ফলাফল রয়েছে—এই ভ্রান্ত ধারণাটি এড়ানো যায়। ( If6a13 , b/127483380 , b/257967987 )
সংস্করণ ২.৫.২
সংস্করণ ২.৫.২
২১ জুন, ২০২৩
androidx.room:room-*:2.5.2 প্রকাশিত হয়েছে। সংস্করণ 2.5.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- kotlinx-metadata-jvm-এর সাথে একটি অসঙ্গতি সমস্যা সমাধান করা হয়েছে। ( 386d5c )
- রোবোইলেকট্রিক টেস্টে ব্যবহার করার সময় Room-এ যে ত্রুটি দেখা দিত, সেই সমস্যাটি সমাধান করা হয়েছে। ( f79bea , b/274924903 )
সংস্করণ ২.৫.১
সংস্করণ ২.৫.১
২২ মার্চ, ২০২৩
androidx.room:room-*:2.5.1 প্রকাশিত হয়েছে। সংস্করণ 2.5.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ডাটাবেস আগে থেকেই খোলা থাকলে
FrameworkSQLiteHelperএ ডাটাবেসের প্যারেন্ট ডিরেক্টরি চেক করা থেকে বিরত থাকুন। ( 5de86b8 ) - Use an
isOpenInternalcheck when checking if the database is already open. ( e91fb35 ) - Better handling of the reentrant case in
acquireTransactionThread()ofRoomis now available. ( 219f98b ). During a suspending transaction, Room uses a thread from the transaction executor, starts an event loop in it and dispatches suspending database operations to it so they are all encapsulated within the transaction coroutine. It is usually expected that the transaction thread is different from the one starting the transaction, but in some cases they are the same. To handle such reentrant cases thewithTransaction()has been refactored to no longer rely on a control job and instead it will execute the suspending transaction block from within therunBlockingin the transaction thread.
Version 2.5.0
Version 2.5.0
২২ ফেব্রুয়ারী, ২০২৩
androidx.room:room-paging-guava:2.5.0 , androidx.room:room-paging-rxjava2:2.5.0 , and androidx.room:room-paging-rxjava3:2.5.0 are released. Version 2.5.0 contains these commits.
Version 2.5.0
১১ জানুয়ারী, ২০২৩
androidx.room:room-*:2.5.0 is released. Version 2.5.0 contains these commits.
Important changes since 2.4.0
- All of
room-runtimesources has been converted from Java to Kotlin. Note that you may encounter source incompatibility issues if your code is in Kotlin due to the library conversion to Kotlin. For example, a known source incompatible change is that inInvalidationTrackeryou will now need to declareonInvalidate()inObserverto have a param of typeSetand notMutableSet. Moreover, certain getter methods were converted to properties requiring the property access syntax on Kotlin files. Please file a bug if there are any significant incompatibilities. - Added a new shortcut annotation,
@Upsert, which attempts to insert an entity when there is no uniqueness conflict or update the entity if there is a conflict. ( I7aaab , b/241964353 ) - New room-paging artifacts
room-paging-rxjava2,room-paging-rxjava3androom-paging-guavahave been added for support in Room Paging. - Added APIs for providing key and value tables names for disambiguation in
@MapInfo( Icc4b5 )
Version 2.5.0-rc01
৭ ডিসেম্বর, ২০২২
androidx.room:room-*:2.5.0-rc01 is released. Version 2.5.0-rc01 contains these commits.
- This release is identical to
2.5.0-beta02.
Version 2.5.0-beta02
৯ নভেম্বর, ২০২২
androidx.room:room-*:2.5.0-beta02 is released. Version 2.5.0-beta02 contains these commits.
এপিআই পরিবর্তন
- Fix various APIs that take query arguments from invariant (
Array<Any?>) to contravariant (Array<out Any?>) to match Java's array behavior. ( b/253531073 )
Version 2.5.0-beta01
৫ অক্টোবর, ২০২২
androidx.room:room-*:2.5.0-beta01 is released. Version 2.5.0-beta01 contains these commits.
এপিআই পরিবর্তন
- Restrict the minimum version that supports
@Upsertto be API 16. This is due to the inability to identity a primary key constraint conflict in older APIs. ( I5f67f , b/243039555 )
বাগ সংশোধন
- Fixed an issue where shadow tables where incorrectly exported to the schema
.jsonfiles, corrupting them. ( I4f83b , b/246751839 )
Version 2.5.0-alpha03
২৪ আগস্ট, ২০২২
androidx.room:room-*:2.5.0-alpha03 is released. Version 2.5.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new shortcut annotation,
@Upsert, which attempts to insert an entity when there is no uniqueness conflict or update the entity if there is a conflict. ( I7aaab , b/241964353 )
বাগ সংশোধন
- Room will now throw a
SQLiteConstraintExceptioninstead of aIllegalStateExceptionduring an auto-migration foreign key constraint check. ( I328dd ) - Fix a Kotlin source incompatible change for getter / properties of
getOpenHelper,getQueryExecutorandgetTransactionExecutor. ( Iad0ac )
Version 2.5.0-alpha02
১ জুন, ২০২২
androidx.room:room-*:2.5.0-alpha02 is released. Version 2.5.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- New
room-pagingartifactsroom-paging-rxjava2,room-paging-rxjava3androom-paging-guavahave been added for support in Room Paging.( 41a1d4 , b/203666906 ),( eb6098 , b/203666906 ),( 1b9ae4 , b/203666906 )
এপিআই পরিবর্তন
- All of
room-runtimehas been converted from Java to Kotlin. ( If2069 , b/206859668 ),( Ie4b55 , b/206859668 ), ( I697ee , b/206859668 ), ( I96c25 , b/206859668 )Note: You may encounter source incompatibility issues due to the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need to handle these cases. For example, a known source incompatible change is that in
InvalidationTrackeryou will now need to declareonInvalidate()inObserverto have a param of typeSetand notMutableSet. - Added APIs for providing key and value tables names for disambiguation in
@MapInfo( Icc4b5 ) - Fix a source compatibility issue to re-allow
@Ignorein property getters. ( Ifc2fb )
বাগ সংশোধন
- Duplicate column resolution heuristic algorithm. Room will now attempt to resolve ambiguous columns in a multimap query. This allows for JOINs with tables containing same-name tables to be correctly mapped to a result data object. ( I4b444 , b/201306012 , b/212279118 )
Version 2.5.0-alpha01
February 23, 2022
androidx.room:room-*:2.5.0-alpha01 is released. Version 2.5.0-alpha01 contains these commits.
এপিআই পরিবর্তন
- Fixed an issue where Room
@IntDefusage were not being enforced in Kotlin sources. ( I75f41 , b/217951311 ) - Fixed a source compatibility issue to re-allow
@Queryin property getters. ( I0a09b ) - Converted room-common from Java to Kotlin. ( I69c48 , b/206858235 )
Note: You may encounter source incompatibility issues as some properties have been moved into companion objects during the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need the ".Companion" suffix when accessing these properties.
- Converted room-migration from Java to Kotlin. ( I2724b , b/206858622 )
- Converted
pagingrelated files inroom-runtimefrom Java to Kotlin. ( I82fc8 , b/206859668 ) - Added API for multi-process lock and usage at the FrameworkSQLite* level, to protect multi-process 1st time database creation and migrations. ( Ied267 , b/193182592 )
বাগ সংশোধন
- Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom
@JvmNameannotations to match getters/setters to private properties, please double check the generated code after the update ( If6531 , b/205289020 )
Version 2.4.3
Version 2.4.3
২৭ জুলাই, ২০২২
androidx.room:room-*:2.4.3 is released. Version 2.4.3 contains these commits.
বাগ সংশোধন
- Fixed an issue that would cause Room to not recognize suspend functions in Kotlin 1.7 ( b/236612358 )
Version 2.4.2
Version 2.4.2
February 23, 2022
androidx.room:room-*:2.4.2 is released. Version 2.4.2 contains these commits.
বাগ সংশোধন
- Fix an issue generating code for a Dao
@Transactionsuspend function with a body that generates a default interface method due to compilation with-Xjvm-default=allor equivalent. ( Ia4ce5 ) - Resolving a bug where Room generates code for a
Array<ByteArray>return type query method. ( If086e , b/213789489 )
Version 2.4.1
Version 2.4.1
১২ জানুয়ারী, ২০২২
androidx.room:room-*:2.4.1 is released. Version 2.4.1 contains these commits.
বাগ সংশোধন
- Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom
@JvmNameannotations to match getters/setters to private properties, please double check the generated code after the update ( If6531 , b/205289020 )
Version 2.4.0
Version 2.4.0
December 15, 2021
androidx.room:room-*:2.4.0 is released. Version 2.4.0 contains these commits.
Important changes since 2.3.0
- Auto Migrations : Room now offers an API for automatically generating migrations as long as schemas are exported. To let Room know that it should generate an auto-migration a new property
@Database#autoMigrationscan be used to declare the versions to auto-migrate from and to. When Room needs additional information regarding tables and column renames or deletes, then the@AutoMigrationannotation can declare a specification class containing such inputs. See the@AutoMigrationdocumentation for more details. - Dependency Injection in Auto Migrations :
@ProvidedAutoMigrationSpecis a new API for declaring that anAutoMigrationSpecwill be provided at runtime viaRoomDatabase.Builder#addAutoMigrationSpec(). This allows for a dependency injection framework to provide such specs when they need complex dependencies. - Migration Test Helper Support for Auto Migrations : Room's
MigrationTestHelperwas updated to support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way duringrunMigrationsAndValidate. - Room-Paging Support :
androidx.room:room-pagingis released, providing native Paging 3.0 support for Room queries returningandroidx.paging.PagingSource. - Relational Query Methods : Room now supports multimap return types
@Daomethods, useful for JOIN statements. The supported types of multimaps areMap,SparseArray,LongSparseArray, along with Guava'sImmutableMap,ImmutableSetMultimapandImmutableListMultimap.
Version 2.4.0-rc01
১ ডিসেম্বর, ২০২১
androidx.room:room-*:2.4.0-rc01 is released. Version 2.4.0-rc01 contains these commits.
নতুন বৈশিষ্ট্য
- Update Room's dependency on KSP to
1.6.0-1.0.1to support Kotlin 1.6
Version 2.4.0-beta02
১৭ নভেম্বর, ২০২১
androidx.room:room-*:2.4.0-beta02 is released. Version 2.4.0-beta02 contains these commits.
নতুন বৈশিষ্ট্য
- We've added support for SparseArray and LongSparseArray in @MapInfo. ( Ic91a2 b/138910317 )
বাগ সংশোধন
- We've added a new TypeConverter analyzer that takes nullability information in types into account. As this information is only available in KSP, it is turned on by default only in KSP. If it causes any issues, you can turn it off by passing room.useNullAwareTypeAnalysis=false to the annotation processor. If that happens, please a file bug as this flag will be removed in the future. With this new TypeConverter analyzer, it is suggested to only provide non-null receiving TypeConverters as the new analyzer has the ability to wrap them with a null check. Note that this has no impact for users using KAPT or Java as the annotation processors (unlike KSP), don't have nullability information in types. ( Ia88f9 , b/193437407 )
- Fix a bug where Room would fail to compile with a SQL error when an FTS entity declared to use the ICU tokenizer. ( I00db9 , b/201753224 )
- Resolved issue in auto migrations regarding a new column added to an embedded Entity between versions. ( I5fcb1 b/193798291 )
- We have resolved an issue regarding the relational query method return types in LEFT JOIN queries. With these changes, in the case where a 1-many mapping is present, the collection returned for a key will not include the invalid value object if it is not found in the cursor. If no valid values are found, then a key will be mapped to an empty collection. ( Id5552 b/201946438 )
- Resolved the auto migration issue where SQLite keywords failed to be escaped in column names. ( Idbed4 b/197133152 )
Version 2.4.0-beta01
১৩ অক্টোবর, ২০২১
androidx.room:room-*:2.4.0-beta01 is released. Version 2.4.0-beta01 contains these commits.
বাগ সংশোধন
- Fixed an issue with auto-migrations not adding new columns when another table in the same auto-migration also had a new column with the same name. ( Ia5db5 , b/200818663 )
- The PagingSource implementation generated by room-paging now uses the
queryExecutorpassed throughRoomDatabase.Builder, so it can be overridden, instead ofDispatchers.IOpreviously. ( Iae259 )
Version 2.4.0-alpha05
২৯ সেপ্টেম্বর, ২০২১
androidx.room:room-*:2.4.0-alpha05 is released. Version 2.4.0-alpha05 contains these commits.
নতুন বৈশিষ্ট্য
- Added a built-in type converter for UUID . ( I671e8 , b/73132006 )
এপিআই পরিবর্তন
Added a new property to the TypeConverters annotation to let developers disable built-in Enum and UUID converters. By default, these converters are on but you can disable them for a certain scope, or for the whole database. See TypeConverters documentation for details. ( 36ae9e , b/195413406 )
Supporting non-POJO keys/values for Multimap return types in DAOs via the
@MapInfoannotation. ( I4d704 )
@MapInfo will be required when the key or value column of the map are from a single column. See example:
@MapInfo(valueColumn = "songCount")
@Query("""
SELECT *, COUNT(mSongId) as songCount
FROM Artist JOIN Song ON Artist.artistName = Song.artist
GROUP BY artistName
""")
fun getArtistAndSongCounts(): Map<Artist, Integer>
- Make
room-paginga required artifact when using Paging3 with Room. ( Ieaffe )
বাগ সংশোধন
- Fix an issue where multimap queries results were not correctly ordered when the query contained an ORDER BY clause of a column from the map's key. ( I6b887 )
বাহ্যিক অবদান
- Added new API to specify index order in @Index. Thanks to Nikita Zhelonkin. ( I033fc )
Version 2.4.0-alpha04
২১ জুলাই, ২০২১
androidx.room:room-*:2.4.0-alpha04 is released. Version 2.4.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
Room now supports multimap return types
@Daomethods, useful for JOIN statements. The supported types of multimaps areMapalong with Guava'sImmutableMap,ImmutableSetMultimapandImmutableListMultimap.The following are examples of multimap queries:
One-to-One Relation Map
@Query("SELECT * FROM Song JOIN Artist ON Song.artistId = Artist.artistId") fun getSongAndArtist(): Map<Song, Artist>One-to-Many Relation Map (Standard multimap)
@Query("SELECT * FROM Artist JOIN Album ON Artist.id = Album.artistId") fun getArtistAndAlbums(): Map<Artist, List<Album>>The multimap result can also be wrapped in the supported async return types, such as
LiveData, Rx'sObservable, or coroutinesFlow.
Room-Paging
androidx.room:room-pagingis released, providing native Paging 3.0 support for Room queries returningandroidx.paging.PagingSource.@Dao interface UserDao { @Query("SELECT * FROM users ORDER BY id ASC") fun loadUsers(): PagingSource<Int, User> }This artifact replaces the
androidx.paging.PagingSourceimplementation generated by Room with one built on top of Paging 3.0 APIs. The new PagingSource implementation parses keys differently, so any key manually supplied to Room's PagingSource would need to account for this behavior change, including the initialKey passed via Pager's constructor. Pages will start loading from theKeywithKeybeing the first loaded item. This deviates from existing behavior whereLoadParams.Refresh.Keyis treated as the user's scroll position and items are loaded both before and after the key.The artifact is optional and opting out will fallback to existing support for Paging 3.0 that was introduced in Room 2.3. However, this artifact will become non-optional in future release for those using Room with Paging 3.0. To opt-in, add the new room-paging artifact to your classpath. If you are using Gradle, you can add the following snippet to your build.gradle:
dependency { implementation("androidx.room:room-paging:2.4.0-alpha04") }
বাগ সংশোধন
- Fix an issue in auto migrations regarding handling foreign key violations. ( b/190113935 )
Version 2.4.0-alpha03
১৬ জুন, ২০২১
androidx.room:room-*:2.4.0-alpha03 is released. Version 2.4.0-alpha03 contains these commits.
এপিআই পরিবর্তন
- Update Room's
MigrationTestHelperto support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way duringrunMigrationsAndValidate.
বাগ সংশোধন
Fixed an issue with Room's SQLite native library to support Apple's M1 chips. ( b/174695268
Fixed an issue where Room would not error out when the return type of a @Transaction function was a Flow ( I56ddd , b/190075899 )
Fix an issue in auto migrations regarding indices. b/177673291
Dependency Updates
- Room's KSP support now depends on KSP
1.5.10-1.0.0-beta01. ( 1ecb11 , b/160322705 )
Version 2.4.0-alpha02
৫ মে, ২০২১
androidx.room:room-*:2.4.0-alpha02 is released. Version 2.4.0-alpha02 contains these commits.
এপিআই পরিবর্তন
-
@ProvidedAutoMigrationSpecis a new API for declaring that anAutoMigrationSpecwill be provided at runtime viaRoomDatabase.Builder#addAutoMigrationSpec(). This allows for a dependency injection framework to provide such specs when they need complex dependencies.
বাগ সংশোধন
- Fix an issue with auto migrations where
@DatabaseViews where not being properly re-created.
বাহ্যিক অবদান
- Fix an issue in Room's
JournalMode.TRUNCATEwhere theInvalidationTrackercallback was sometimes being invoked invalidly, too late, or not at all. Thanks toUli Bubenheimer | bubenheimer@users.noreply.github.com( b/154040286 )
Version 2.4.0-alpha01
২১ এপ্রিল, ২০২১
androidx.room:room-*:2.4.0-alpha01 is released. Version 2.4.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- Auto Migrations : Room now offers an API for automatically generating migrations as long as schemas are exported. To let Room know that it should generate an auto-migration a new property
@Database#autoMigrationscan be used to declare the versions to auto-migrate from and to. When Room needs additional information regarding tables and column renames or deletes, then the@AutoMigrationannotation can declare a specification class containing such inputs. See the@AutoMigrationdocumentation for more details.
বাগ সংশোধন
- Fix an issue where
defaultValuewith extra parenthesis were being incorrectly validated by Room's schema validation. b/182284899
সংস্করণ ২.৩.০
সংস্করণ ২.৩.০
২১ এপ্রিল, ২০২১
androidx.room:room-*:2.3.0 is released. Version 2.3.0 contains these commits.
Important changes since 2.2.0
- Built-in Enum Support : Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one.
- Query Callback : Room now offers a general callback API RoomDatabase.QueryCallback, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set via
RoomDatabase.Builder#setQueryCallback(). - Pre-packaged Improvement : Room now has APIs for creating a database using a pre-packaged database read from an input stream. This allows for cases such as when the pre-package database is gzipped.
- Provided Type Converters : Room now has APIs for providing instances of type converters such that the app can control their initialization. To mark a type converter that will be provided to Room use the new annotation @ProvidedTypeConverter.
- RxJava3 Support : Room now supports RxJava3 types. Similar to RxJava2 you can declare DAO methods whose return type are Flowable, Single, Maybe and Completable. Additionally a new artifact
androidx.room:room-rxjava3is available to support RxJava3. - Paging 3.0 Support : Room will now support generating implementations for
@Queryannotated methods whose return type isandroidx.paging.PagingSource.
Version 2.3.0-rc01
২৪ মার্চ, ২০২১
androidx.room:room-*:2.3.0-rc01 is released. Version 2.3.0-rc01 contains these commits.
বাগ সংশোধন
- Fix an issue that prevented Coroutine Flow queries created by Room to be consumed in a suspending
withTransactionblock. ( I797bf )
Version 2.3.0-beta03
১০ মার্চ, ২০২১
androidx.room:room-*:2.3.0-beta03 is released. Version 2.3.0-beta03 contains these commits.
নতুন বৈশিষ্ট্য
- Added incremental compilation support for KSP. ( I031c1 , b/176453350 )
বাগ সংশোধন
- Fixed a bug where creating PagingSource on the main thread could trigger an ANR. ( I42b74 , b/181221318 )
- Fixed
@ExperimentalRoomApivisibility to be public instead of package private. ( b/181356119 )
বাহ্যিক অবদান
- Allow Room to accept a POJO return type in a
@Queryannotated DAO method when it is also annotated with@SkipQueryVerification. Room will do a best-effort to convert the result of the query to the POJO return type the same way it is done for a@RawQueryannotated DAO method. Thanks to 'Markus Riegel | hey@marcorei.com'. ( I45acb )
Version 2.3.0-beta02
February 18, 2021
androidx.room:room-*:2.3.0-beta02 is released. Version 2.3.0-beta02 contains these commits.
নতুন বৈশিষ্ট্য
Room now has experimental support for Kotlin Symbol Processing KSP .
KSP is a replacement for KAPT to run annotation processors natively on the Kotlin compiler, significantly reducing build times.
To use Room with KSP, you can apply the KSP Gradle plugin and replace the
kaptconfiguration in your build file withksp. For example, instead ofkapt 'androidx.room:room-compiler:2.3.0-beta02'useksp 'androidx.room:room-compiler:2.3.0-beta02'. See the KSP documentation for more details.Note that since KSP is experimental, it is recommended to still use KAPT for production code. The reduction of build times is only applicable if there are no other processors that use KAPT. See b/160322705 for known issues.
Version 2.3.0-beta01
২৭ জানুয়ারী, ২০২১
androidx.room:room-*:2.3.0-beta01 is released. Version 2.3.0-beta01 contains these commits.
নতুন বৈশিষ্ট্য
- Auto Closable Databases : Room now has the ability to close databases that are not accessed after a given amount of time. This is an experimental feature and can be enabled by calling
RoomDatabase.Builder#setAutoCloseTimeout(). This feature is useful for applications with multiple databases.
বাগ সংশোধন
- Fix an issue where Dao methods with multiple
@Updateor@Deletemethods with different conflict strategies would generate code with only one of the strategies, effectively ignoring the defined one. ( /I0b90d , b/176138543 )
Version 2.3.0-alpha04
১৬ ডিসেম্বর, ২০২০
androidx.room:room-*:2.3.0-alpha04 is released. Version 2.3.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
- Room now offers a general callback API
RoomDatabase.QueryCallback, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set viaRoomDatabase.Builder#setQueryCallback(). ( Iaa513 , b/174478034 , b/74877608 ) - Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one. ( b/73132006 )
Known Issue
- If a one-way type converter for reading already exists for the Enum, Room might accidentally use the built-in String to Enum converter which might not be desired. This is a known issue and can be fixed by making it a two-way converter. See: b/175707691
বাগ সংশোধন
- Fixed an issue where Room would incorrectly disabled incremental annotation processing in newer JDK versions. ( b/171387388 )
- Fixed an issue with Room finding the generated class when multiple class loaders are used. Thanks for the fix 'Serendipity | 892449346@qq.com'! ( b/170141113 )
- Fixed an issue where Room would generate incorrect code when a Kotlin
@Daohad a base class whose generics are primitives in the JVM. ( b/160258066 )
বাহ্যিক অবদান
- Room will now default to using
beginTransactionNonExclusiveif WAL mode is enabled and API is 16 or more. Thanks to 'Ahmed I. Khalil | ahmedibrahimkhali@gmail.com'! ( b/126258791 )
Version 2.3.0-alpha03
১৪ অক্টোবর, ২০২০
androidx.room:room-*:2.3.0-alpha03 is released. Version 2.3.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
Room now has APIs for providing instances of type converters such that the app can control their initialization. To mark a type converter that will be provided to Room use the new annotation
@ProvidedTypeConverter. Thanks to 'mzgreen yairobbe@gmail.com '. ( Ie4fa5 , b/121067210 )Room now has APIs for creating a database using a pre-packaged database read from an input stream. This allows for cases such as when the pre-package database is gzipped. Thanks to 'Ahmed El-Helw ahmedre@gmail.com ' ( 3e6792 , b/146911060 )
এপিআই পরিবর্তন
Added missing target to
@ForeignKeyannotation preventing its usage outside of the@Entityannotation. ( Iced1e )The field
mCallbacksinRoomDatabase.javais now hidden. ( d576cb , b/76109329 )
বাগ সংশোধন
Update to TypeConverters documentation to clarify that TypeConverters can only be used to convert columns / fields and not rows. ( I07c56 , b/77307836 )
Update to the DaoProcessor to fix compiler error on Dao with a generic super type with Kotlin "primitives". ( Ice6bb , b/160258066 )
Update add/remove observer methods documentation to clarify threading ( Ifd1d9 , b/153948821 )
Fix an issue with Room incorrectly validating FTS tables that declared their rowid column. ( d62ebc , b/145858914 )
External Contributions
Fix upper/lowercase locale issues related to Turkish ( 5746e3 ), b/68159494
Replace the
ConcurrentHashMapinsideRoomDatabasewithCollections.synchronizedMap()to avoid issues on Android Lollipop ( d1cfc7 , b/162431855 )Add a onOpenPrepackagedDatabase callback for when a prepackaged DB is copied. ( I1ba74 , b/148934423 )
Version 2.3.0-alpha02
২২ জুলাই, ২০২০
androidx.room:room-*:2.3.0-alpha02 is released. Version 2.3.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- RxJava3 Support : Room now supports RxJava3 types. Similar to RxJava2 you can declare DAO methods whose return type are Flowable, Single, Maybe and Completable. Additionally a new artifact
androidx.room:room-rxjava3is available to support RxJava3. ( b/152427884 )
এপিআই পরিবর্তন
- Declaring a
@TypeConverterin Kotlin Object class is now supported. ( b/151110764 ) -
Roomincremental annotation processing option is now ON by default. ( b/112110217 )
Version 2.3.0-alpha01
১০ জুন, ২০২০
androidx.room:room-*:2.3.0-alpha01 is released. Version 2.3.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
Paging 3.0 Support : Room will now support generating implementations for
@Queryannotated methods whose return type isandroidx.paging.PagingSource.@Dao interface UserDao { @Query("SELECT * FROM users ORDER BY id ASC") fun pagingSource(): PagingSource<Int, User> }
এপিআই পরিবর্তন
-
@RewriteQueriesToDropUnusedColumnsis a new convenient annotation that makes Room rewrite the '*' projection in a query such that unused columns in the result are removed. - The processor option
room.expandProjectionis now deprecated. Use@RewriteQueriesToDropUnusedColumnsas a replacement for Room optimizing queries with star projections. Note that@RewriteQueriesToDropUnusedColumnsdoes not replace the column conflict solutionroom.expandProjectionoffered with regards to return types that contained@Embeddedfields.
বাগ সংশোধন
- Fixed a bug where Room would not correctly detect the JDK version used to enable incremental annotation processor. Thanks to Blaz Solar (me@blaz.solar) ( b/155215201 )
- Room now embeds its ANTLR dependency with the annotation processor to avoid version conflicts with other processors that also use ANTLR. ( b/150106190 )
Version 2.2.6
Version 2.2.6
১৬ ডিসেম্বর, ২০২০
androidx.room:room-*:2.2.6 is released. Version 2.2.6 contains these commits.
বাগ সংশোধন
- Fixed an issue where Room would incorrectly disabled incremental annotation processing in newer JDK versions. ( b/171387388 )
Version 2.2.5
Version 2.2.5
১৮ মার্চ, ২০২০
androidx.room:room-*:2.2.5 is released. Version 2.2.5 contains these commits.
বাগ সংশোধন
- Make
MultiInstanceInvalidationServicedirectBootAware. Thanks to 'Mygod contact-git@mygod.be ' ( b/148240967 ) - Fixed a bug that would cause a crash when multi-instance invalidation was enabled and the database contained a FTS entity. ( b/148969394 )
- Fixed an issue when loading the SQLite native libraries in the Room annotation processor that would cause the compiler to crash due to parallel compilations. ( b/146217083 )
Version 2.2.4
Version 2.2.4
১৯ ফেব্রুয়ারি, ২০২০
androidx.room:room-common:2.2.4 , androidx.room:room-compiler:2.2.4 , androidx.room:room-guava:2.2.4 , androidx.room:room-ktx:2.2.4 , androidx.room:room-migration:2.2.4 , androidx.room:room-runtime:2.2.4 , androidx.room:room-rxjava2:2.2.4 , and androidx.room:room-testing:2.2.4 are released. Version 2.2.4 contains these commits.
বাগ সংশোধন
- Fixed an issue with suspending transactions where they would deadlock if the coroutine was canceled quickly before the transaction actually started. ( b/148181325 )
- Fixed an issue with the @Generated being wrongly used when building with JDK 9. ( b/146538330 )
- Fixed an issue where Room would generate incorrect code when a DAO interface in Kotlin had a concrete function. ( b/146825845 )
Version 2.2.3
Version 2.2.3
December 18, 2019
androidx.room:room-*:2.2.3 is released. Version 2.2.3 contains these commits .
বাগ সংশোধন
- Fixed a bug where Room would fail to validate a database that had not gone through any migration and contained a legacy hash with indices in its schema. ( b/139306173 )
Version 2.2.2
Version 2.2.2
২০ নভেম্বর, ২০১৯
androidx.room:room-*:2.2.2 is released. Version 2.2.2 contains these commits .
বাগ সংশোধন
- Fixed a bug where collecting a one-to-one relationship with more than 999 rows would cause Room to return null relating items. ( b/143105450 )
Version 2.2.1
Version 2.2.1
২৩ অক্টোবর, ২০১৯
androidx.room:room-*:2.2.1 is released. Version 2.2.1 contains these commits .
বাগ সংশোধন
- Fixed a bug where Room would incorrectly warn about
CURSOR_MISMATCHwith the compiler optionexpandProjectionturned ON. ( b/140759491 ) - Added a retry mechanism for handling the missing native library used for verifying queries during compile time.
সংস্করণ ২.২.০
সংস্করণ ২.২.০
৯ অক্টোবর, ২০১৯
androidx.room:room-*:2.2.0 is released. Version 2.2.0 contains these commits .
Important changes since version 2.1.0
- Pre-packaged Database : Two new APIs in
RoomDatabase.Builderare now available for creating aRoomDatabasegiven an already populated database file.createFromAsset()is for when the pre-populated database file is in the assets folder of the APK, whilecreateFromFile()is for when the file is in an arbitrary location. The usages of these API change the behaviour of destructive migrations such that during a fallback migration, Room will try to re-copy the pre-populated database if available, otherwise it fallbacks to just dropping and re-creating all tables. b/62185732 - Schema Default Values :
@ColumnInfonow has a new propertydefaultValuethat can be used to specify the default value of a column. Default values are part of a database schema and will be validated during migrations if specified. b/64088772 - Many-to-Many Relations :
@Relationnow has a new propertyassociateBy, that takes in a new annotation@Junction, used to declare a relation that needs to be satisfied via a junction table (also known as a join table). b/69201917 - One-to-One Relations : The restriction in POJO fields annotated with
@Relationto be of typeListorSethas been lifted, effectively allowing single-value relations to be represented. b/62905145 - Target Entity : The DAO annnotations
@Insert,@Updateand@Deletenow has a new propertytargetEntity, that allows specifying the target table the DAO method is meant to act on. This allows for the parameters of those DAO methods to be arbitrary POJOs which will be interpreted as partial entities. In practice, this allows partial inserts, deletes and updates. b/127549506 - Coroutines Flow :
@QueryDAO methods can now be of return typeFlow<T>. The returned Flow will re-emit a new set of values if the observing tables in the query are invalidated. Declaring a DAO function with aChannel<T>return type is an error, Room instead encourages you to useFlowand then use the neighboring functions to convert theFlowinto aChannel. b/130428884 - Gradle Incremental Annotation Processor : Room is now a Gradle isolating annotation processor and incrementability can be enabled via the processor option
room.incremental. See Room Compiler Options for more information. If you encounter any issues please file a bug here . We plan to enable incrementability by default in a future, stable version. b/112110217 - Expanding Projections : A new experimental compiler option
room.expandProjectionwas added that causes Room to rewrite a query with a star projection to only contain the columns in the returning type POJO. For example, for a DAO method with@Query("SELECT * FROM Song")that returns a POJO namedSongIdAndTitlewith only two fields. Then Room will rewrite the query toSELECT id, title FROM Songsuch that the minimum set of columns to satisfy the return type are fetched. This essentially eliminates theCURSOR_MISMATCHwarning that is presented when the query returns extra columns that do not match any field in the returning POJO type.
Version 2.2.0-rc01
৫ সেপ্টেম্বর, ২০১৯
androidx.room:room:2.2.0-rc01 is released. The commits included in this version can be found here .
No public changes since Room 2.2.0-beta01 .
Version 2.2.0-beta01
২২শে আগস্ট, ২০১৯
androidx.room:room-*:2.2.0-beta01 is released. The commits included in this version can be found here .
বাগ সংশোধন
- Fixed a bug where a Coroutine Flow query would stop reemitting new values after a certain time. ( b/139175786 )
- Fixed a bug where Room would not accept a legacy schema hash code while opening a database that had not gone a migration since Room 1.0, causing a runtime crash due to invalid schema. ( b/139306173 )
Version 2.2.0-alpha02
৭ আগস্ট, ২০১৯
androidx.room:room-*:2.2.0-alpha02 is released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Coroutines Flow :
@QueryDAO methods can now be of return typeFlow<T>. The returned Flow will re-emit a new set of values if the observing tables in the query are invalidated. Declaring a DAO function with aChannel<T>return type is an error, Room instead encourages you to useFlowand then use the neighboring functions to convert theFlowinto aChannel. b/130428884 - Expanding Projections : A new experimental compiler option
room.expandProjectionwas added that causes Room to rewrite a query with a star projection to only contain the columns in the returning type POJO. For example, for a DAO method with@Query("SELECT * FROM Song")that returns a POJO namedSongIdAndTitlewith only two fields. Then Room will rewrite the query toSELECT id, title FROM Songsuch that the minimum set of columns to satisfy the return type are fetched. This essentially eliminates theCURSOR_MISMATCHwarning that is presented when the query returns extra columns that do not match any field in the returning POJO type. -
onDestructiveMigrateis a new callback API added toRoomDatabase.Callbackfor when Room destructively migrates a database. b/79962330
বাগ সংশোধন
- Fixed a bug where Room would generate incorrect code using a method as field setter when the field is protected. b/136194628
- Fixed a bug that caused the InvalidationTracker to throw a NPE in a second process when multi-instance invalidation was enabled and the invalidation Service was killed. b/137454915
- Fixed a bug where Room would not correctly identify the return type of an inherited suspend function annotated with
@RawQuery. b/137878827 - Updated the generated code for
@Relationwhen the relating key is of type BLOB to use aByteBufferthat is comparable. b/137881998 - Fixed a bug where Room would complain about missing setters on POJOs used as partial entity parameters of
@Insert,@Updateand@Delete. b/138664463 - Fixed a bug where Room would complain about missing getters & setters for an ignored column via
@Entitywhen the entity class was used in certain DAO methods. b/138238182 - Fixed a bug where Room would not correctly convert named binding args to positional args causing a runtime exception when executing a query with re-used parameters. b/137254857
Version 2.2.0-alpha01
July 10, 2019
নতুন বৈশিষ্ট্য
- Pre-packaged Database : Two new APIs in
RoomDatabase.Builderare now available for creating aRoomDatabasegiven an already populated database file.createFromAsset()is for when the pre-populated database file is in the assets folder of the APK, whilecreateFromFile()is for when the file is in an arbitrary location. The usages of these API change the behaviour of destructive migrations such that during a fallback migration, Room will try to re-copy the pre-populated database if available, otherwise it fallbacks to just dropping and re-creating all tables. b/62185732 - Schema Default Values :
@ColumnInfonow has a new propertydefaultValuethat can be used to specify the default value of a column. Default values are part of a database schema and will be validated during migrations if specified. b/64088772Note: If your database schema already has default values, such as those added via
ALTER TABLE x ADD COLUMN y INTEGER NOTNULL DEFAULT z, and you decide to define default values via@ColumnInfoto the same columns, then you might need to provide a migration to validate the unaccounted default values. See Room Migrations for more information. - Many-to-Many Relations :
@Relationnow has a new propertyassociateBy, that takes in a new annotation@Junction, used to declare a relation that needs to be satisfied via a junction table (also known as a join table). b/69201917 - One-to-One Relations : The restriction in POJO fields annotated with
@Relationto be of typeListorSethas been lifted, effectively allowing single-value relations to be represented. b/62905145 - Target Entity : The DAO annnotations
@Insert,@Updateand@Deletenow has a new propertytargetEntity, that allows specifying the target table the DAO method is meant to act on. This allows for the parameters of those DAO methods to be arbitrary POJOs which will be interpreted as partial entities. In practice, this allows partial inserts, deletes and updates. b/127549506 - Gradle Incremental Annotation Processor : Room is now a Gradle isolating annotation processor and incrementability can be enabled via the processor option
room.incremental. See Room Compiler Options for more information. If you encounter any issues please file a bug here . We plan to enable incrementability by default in a future, stable version. b/112110217
বাগ সংশোধন
- Room will no longer propagate the
EmptySetResultExceptionto the global error handler when the Rx stream of a query has been disposed before the query is complete. b/130257475 - Fixed a bug where Room would show an incorrect error message when a suspend DAO function annotated with
@RawQuerydidn't have a return type. b/134303897 - Room will no longer generate DAO adapters with raw types. b/135747255
সংস্করণ ২.১.০
সংস্করণ ২.১.০
১৩ জুন, ২০১৯
Room 2.1.0 is released with no changes from 2.1.0-rc01 . The commits included in the version can be found here .
Important changes since 2.0.0
- FTS : Room now supports entities with a mapping FTS3 or FTS4 table. Classes annotated with
@Entitycan now be additionally annotated with@Fts3or@Fts4to declare a class with a mapping full-text search table. FTS options for further customization are available via the annotation's methods. - Views : Room now supports declaring a class as a stored query, also known as a view , using the
@DatabaseViewannotation. - Couroutines : DAO methods can now be suspend functions. Include
room-ktxin your dependencies to take advantage of this functionality. The ktx artifact also provides the extension functionRoomDatabase.withTransactionfor performing database transactions within a coroutine. - Auto Value : Room now supports declaring AutoValue annotated classes as entities and POJOs. The Room annotations
@PrimaryKey,@ColumnInfo,@Embeddedand@Relationcan now be declared in an auto value annotated class's abstract methods. Note that these annotation must also be accompanied by@CopyAnnotationsfor Room to properly understand them. - Additional Async Support : DAO methods annotated with
@Insert,@Deleteor@Update, along with@QuerycontainingINSERT,DELETEorUPDATEstatements, now support Rx return typesCompletable,Single,Maybe, and Guava's return typeListenableFuture, and they can also be suspend functions. -
enableMultiInstanceInvalidationis a new API inRoomDatabase.Builderto enable invalidation across multiple instances of RoomDatabase using the same database file. -
fallbackToDestructiveMigrationOnDowngradeis a new API inRoomDatabase.Builderto automatically re-create the database if a downgrade happens. -
ignoredColumnsis a new API in the@Entityannotation that can be used to list ignored fields by name. - Room will now properly use Kotlin's primary constructor in data classes avoiding the need to declare the properties as
vars.
Version 2.1.0-rc01
২৯ মে, ২০১৯
বাগ সংশোধন
- Fixed a Room initialization error that might occur due to an already setup temp_store configuration. b/132602198
- Fixed a double quote usage warning for users with SQLite 3.27.0 and above. b/131712640
- Fixed a bug where the InvalidationTracker would cause a crash when multiple invalidation checks would occur in parallel. b/133457594
Version 2.1.0-beta01
৭ মে, ২০১৯
androidx.room 2.1.0-beta01 is released with no changes from 2.1.0-alpha07. The commits included in this version can be found here .
Version 2.1.0-alpha07
April 25, 2019
API / Behavior Changes
- The extension function
RoomDatabase.withTransactionhas been changed to no longer take a function block with aCoroutineScopeas receiver. This prevents skipping the additionalcoroutineScope { }wrapper required to run things in the transaction block concurrently.
বাগ সংশোধন
- Fixed a bug where Room would fail to match a TypeConverter for a Kotlin DAO function containing a parameter of Collection type. b/122066791
Version 2.1.0-alpha06
২২ মার্চ, ২০১৯
API / Behavior Changes
- Async transaction queries are now serialized such that Room will not use more than one thread for executing database transactions.
RoomDatabase.Builder.setTransactionExecutor(Executor)was added to allow configuring the executor to be used for transactions. -
RoomDatabase.runInTransaction(Callable)will no longer wrap checked exceptions into RuntimeExceptions. b/128623748
বাগ সংশোধন
- Fixed a bug where the invalidation tracker would stop observing a content table if observers for both the content table and an external content FTS table were added. b/128508917
- Updated
RoomSQLite grammar to match SQLite 3.24.0. b/110883668
Version 2.1.0-alpha05
১৩ মার্চ, ২০১৯
নতুন বৈশিষ্ট্য
- The extension function
RoomDatabase.withTransactionallows you to safely perform database transactions within a coroutine. Room extensions functions along with coroutines support are available in theroom-ktxartifact. - Non-abstract DAO methods annotated with
@Transactioncan now be suspend functions. b/120241587
API / Behavior Changes
- The artifact
room-coroutineshas been renamed toroom-ktxfollowing the same naming as other androidx artifacts. -
beginTransaction,setTransactionSuccessfulandendTransactioninRoomDatabasehave been deprecated in favor ofrunInTransactionand theroom-ktxextension functionwithTransaction.
বাগ সংশোধন
- Fixed a bug where tokenizer arguments were being dropped if the tokenizer used was SIMPLE. b/125427014
- Fixed a bug where Room would fail to correctly identify suspending functions with parameters whos type were an inner class. b/123767877
- Fixed a bug where deferred
@QueryDAO method withINSERT,UPDATEorDELETEstatements were eagerly preparing the query in the main thread. b/123695593 - Fixed various bugs where Room would generate incorrect code for certain suspend functions. b/123466702 and b/123457323
- Fixed a bug where deprecated usage of methods were not being correctly suppressed in generated code. b/117602586
- Updated Room dependency of androidx.sqlite to 1.0.2 which contain fixes for correctly handling corrupted databases. b/124476912
পরিচিত সমস্যা
- Room 2.1.0-alpha05 depends on the
kotlinx-metadata-jvmartifact which is not currently available in Maven Central ( KT-27991 ). This dependency can be resolved by addingmaven { url "https://kotlin.bintray.com/kotlinx/" }to your project repositories.
Version 2.1.0-alpha04
২৫ জানুয়ারী, ২০১৯
নতুন বৈশিষ্ট্য
- DAO methods annotated with
@QuerycontainingINSERT,UPDATEorDELETEstatements can now return async typesSingle,Mayble,CompletableandListenableFuture. Additionally they can also be suspend functions. b/120227284
API / Behavior Changes
- Room will now throw an error if a non-abstract DAO method annotated with
@Transactionreturns an async type such asSingle,Mayble,Completable,LiveDataorListenableFuture. Since transactions are thread confined it is currently impossible for Room to begin and end a transaction around a function that may peform queries in different threads. b/120109336 -
OnConflictStrategy.FAILandOnConflictStrategy.ROLLBACKhave been@Deprecatedsince they do not behave as intended with Android's current SQLite bindings. b/117266738
বাগ সংশোধন
- Fixed a bug where Room wouldn't correctly use the TypeConverter of a return type if the DAO method was a suspend function. b/122988159
- Fixed a bug where Room would incorrectly identify inherited suspend functions as non-suspending. b/122902595
- Fixed a bug where Room would generate incorrect code when an
@Embeddedfield was in a parent class and used in multiple child classes. b/121099048 - Fixed an issue where the database would deadlock when invoking DAO suspend functions between a
beginTransaction()andendTransaction(). b/120854786
Version 2.1.0-alpha03
৪ ডিসেম্বর, ২০১৮
এপিআই পরিবর্তন
- The FTS
tokenizerin@Fts3/@Fts4now takes a String instead of an Enum. This allows custom tokenizers to be used by Room. Built-in tokenizers are still defined inFtsOptionsas string constants. b/119234881
নতুন বৈশিষ্ট্য
- Couroutines : DAO methods can now be suspend functions. To support suspend functions in Room a new artifact has been released,
room-coroutines. b/69474692 - DAO methods annotated with
@Insert,@Deleteor@Updatenow supportListenableFutureas return type. b/119418331
বাগ সংশোধন
- Fixed a bug where Room would incorrectly attempt to find a constructor with columns in the
ignoredColumnsproperty of@Entity. b/119830714 - Fixed a bug where Room would not mark DAO method parameters as final in their generated implementation. b/118015483
- Fixed a bug where
Roomprocessor would crash when reporting an error on a query with special symbols. b/119520136 - Fixed a bug where Room would decline other various
Collectionimplementations as arguments of anINexpression. b/119884035 - Fixed a bug where LiveData returned from Room would get garbage collected when observed forever causing it to no longer emit new data. b/74477406
- Updated
RoomDatabase's close lock to reduce lock contention. b/117900450
Version 2.1.0-alpha02
৩০ অক্টোবর, ২০১৮
নতুন বৈশিষ্ট্য
- Added support for referencing a
@DatabaseViewin a@Relation. b/117680932
বাগ সংশোধন
- Fixed a bug where Room would perform disk I/O in the main thread when subscribing and disposing from an Rx return type. b/117201279
- Fixed a bug where Room would fail to find an appropriate type converter for a field in a Kotlin entity class. b/111404868
- Fixed a bug where Room would generate incorrect code for a
DAOinterface implementation containing a Kotlin default method that has no arguments. b/117527454 - Updated
RoomSQLite grammar parser, fixing a performance issue that would cause long build times. b/117401230
Version 2.1.0-alpha01
October 8, 2018
নতুন বৈশিষ্ট্য
- FTS : Room now supports entities with a mapping FTS3 or FTS4 table. Classes annotated with
@Entitycan now be additionally annotated with@Fts3or@Fts4to declare a class with a mapping full-text search table. FTS options for further customization are available via the annotation's methods. b/62356416 - Views : Room now supports declaring a class as a stored query, also known as a view using the @DatabaseView annotation. b/67033276
- Auto Value : Room now supports declaring AutoValue annotated classes as entities and POJOs. The Room annotations
@PrimaryKey,@ColumnInfo,@Embeddedand@Relationcan now be declared in an auto value annotated class' abstract methods. Note that these annotation must also be accompanied by@CopyAnnotationsfor Room to properly understand them. b/62408420 - Additional Rx Return Types Support : DAO methods annotated with
@Insert,@Deleteor@Updatenow support Rx return typesCompletable,Single<T>andMaybe<T>. b/63317956 - Immutable Types with
@Relation: Room previously required@Relationannotated fields to be settable but now they can be constructor parameters. -
enableMultiInstanceInvalidation: Is a new API inRoomDatabase.Builderto enable invalidation across multiple instances of RoomDatabase using the same database file. This multi-instance invalidation mechanism also works across multiple processes. b/62334005 -
fallbackToDestructiveMigrationOnDowngrade: Is a new API inRoomDatabase.Builderto automatically re-create the database if a downgrade happens. b/110416954 -
ignoredColumns: Is a new API in the@Entityannotation that can be used to list ignored fields by name. Useful for ignoring inherited fields on an entity. b/63522075
API / Behavior Changes
-
mCallbackandmDatabaseinRoomDatabaseare now@Deprecatedand will be removed in the next major version of Room. b/76109329
বাগ সংশোধন
- Fixed two issues where Room wouldn't properly recover from a corrupted database or a bad migration during initialization. b/111504749 and b/111519144
- Room will now properly use Kotlin's primary constructor in data classes avoiding the need to declare the fields as
vars. b/105769985
Version 2.0.0
Version 2.0.0
১ অক্টোবর, ২০১৮
androidx.room 2.0.0 is released with no changes from 2.0.0-rc01.
Version 2.0.0-rc01
September 20, 2018
androidx.room 2.0.0-rc01 is released with no changes from 2.0.0-beta01.
Version 2.0.0-beta01
July 2, 2018
API / Behavior Changes
- Added
RoomDatabase.Builder.setQueryExecutor()to allow customization of where queries are run - Added RxJava2
Observablesupport - Generated DAO and Database implementations are now final
বাগ সংশোধন
- Specify class/field name in "cannot find getter for field" error b/73334503
- Fixed RoomOpenHelper backwards compatibility with older versions of Room b/110197391
Pre-AndroidX Dependencies
For the pre-AndroidX versions of Room, include these dependencies:
dependencies {
def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version" // For Kotlin use kapt instead of annotationProcessor
// optional - RxJava support for Room
implementation "android.arch.persistence.room:rxjava2:$room_version"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "android.arch.persistence.room:guava:$room_version"
// Test helpers
testImplementation "android.arch.persistence.room:testing:$room_version"
}
সংস্করণ ১.১.১
সংস্করণ ১.১.১
১৯ জুন, ২০১৮
Room 1.1.1 is identical to Room 1.1.1-rc1 .
Version 1.1.1-rc1
May 16, 2018 We highly recommend using Room 1.1.1-rc1 instead of 1.1.0 if you are using migrations.
Fixed a bug where Room would not handle post migration initialization properly b/79362399
সংস্করণ ১.১.০
Version 1.1.0-beta3
১৯ এপ্রিল, ২০১৮
বাগ সংশোধন
- Fix compilation error when a Kotlin POJO references a relation entity that was defined in Java b/78199923
Version 1.1.0-beta2
April 5, 2018
বাগ সংশোধন
Fixed a critical bug in
RoomRxSingleandMaybeimplementations where it would recycle the query ahead of time, causing problems if you add more than 1 observer to the returnedSingleorMaybeinstances. b/76031240[RoomDatabase.clearAllTables][ref-clearAllTables] will not
VACUUMthe database if it is called inside a transaction. b/77235565
Version 1.1.0-beta1
২১ মার্চ, ২০১৮
এপিআই পরিবর্তন
- Based on API Review feedback,
@RawQuerydoes not accept passing aStringas the query parameter anymore. You need to use [SupportSQLiteQuery][ref-SupportSQLiteQuery]. (see [SimpleSQLiteQuery][ref-SimpleSQLiteQuery] to easily create an instance of [SupportSQLiteQuery][ref-SupportSQLiteQuery] with argument support). - RoomDatabase.Builder's [fallbackToDestructiveMigrationFrom][ref-fallbackToDestructiveMigrationFrom] method now accepts
vararg intinstead ofvararg Integer.
বাগ সংশোধন
- [RoomDatabase.clearAllTables][ref-clearAllTables] now tries to return space back to the operating system by setting a WAL checkpoint and
VACUUMing the database. - [
@RawQuery][ref-RawQuery] now accepts any Pojo for theobservedEntitiesproperty as long as the Pojo references to one or more entities via itsEmbeddedfields orRelations. b/74041772 - Paging: Room's DataSource implementation now correctly handles multi-table dependencies (such as relations, and joins). Previously these would fail to trigger new results, or could fail to compile. b/74128314
Version 1.1.0-alpha1
January 22, 2018
নতুন বৈশিষ্ট্য
-
RawQuery: This new API allows@Daomethods to receive the SQL as a query parameter b/62103290 , b/71458963 -
fallBackToDestructiveMigrationsFrom: This new API inRoomDatabase.Builderallows for finer grained control over from which starting schema versions destructive migrations are allowed (as compared to fallbackToDestructiveMigration) b/64989640 - Room now only supports newer Paging APIs (alpha-4+), dropping support for the deprecated
LivePagedListProvider. To use the new Room alpha, you'll need to use pagingalpha-4or higher, and switch fromLivePagedListProvidertoLivePagedListBuilderif you haven't already.
বাগ সংশোধন
- Improved support for Kotlin Kapt types. b/69164099
- Order of fields do not invalidate schema anymore. b/64290754